1 / 8

Text editors

Text editors. Why should I use an editor ?. It is very important to able to use at least one text mode editor. a text mode editor is so useful on remote machines. some editors like as vi and emacs are so useful for programming. Which editor should I use ?. GNU Emacs. Vi(m).

marcy
Download Presentation

Text editors

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Text editors Why should I use an editor ? It is very important to able to use at least one text mode editor a text mode editor is so useful on remote machines some editors like as vi and emacs are so useful for programming Which editor should I use ? GNU Emacs Vi(m)

  2. Vim stands for Vi Improved. Vim is a text editor which includes almost all the commands from the UNIX program vi and a lot of new ones Commands in the vi editor are entered using only the keyboard, which has the advantage that you can keep your fingers on the keyboard and your eyes on the screen, rather than moving your arm repeatedly to the mouse gvim, the Gnome version of vim, Beginning users might find this esier to use

  3. Using the Vim editor Two modes commad mode The editor always starts in command mode. Commands move you through the text, search, replace, mark blocks and perform other editing tasks, and some of them switch the editor to insert mode. insert mode To get back to normal mode, press the <Esc> key.

  4. Basic commands Moving through the text h to move the cursor to the left l to move it to the right k to move up j to move down n k SHIFT-G will put the prompt at the end of the document or capital g who ever heard of using l for right?

  5. Basic operations n dd will delete n lines starting from the current cursor position. n dw will delete n words at the right side of the cursor. x will delete the character on which the cursor is positioned :n moves to line n of the file. :w will save (write) the file :q will exit the editor. :q! forces the exit when you want to quit a file containing unsaved changes. :wq will save and exit

  6. Basic operations :w newfile will save the text to newfile. :wq! overrides read-only permission (if you have the permission to override permissions, for instance when you are using the root account. /astring will search the string in the file and position the cursor on the first match below its position. / will perform the same search again, moving the cursor to the next match. :1, $s/word/anotherword/g will replace word with anotherword throughout the file. yy will copy a block of text. n p will paste it n times. :recover will recover a file after an unexpected interruption. u undo

  7. Basic operations substitute command :range substitute /from/to/ flags :% substitute /Professor/Teacher/ :substitute /Professor/Teacher/ :% substitute /Professor/Teacher/g :% substitute /Professor/Teacher/c

  8. Commands that switch the editor to insert mode a will append: it moves the cursor one position to the right before switching to insert mode i will insert o will insert a blank line under the current cursor position and move the cursor to that line. Pressing the Esc key switches back to command mode. vimtutor

More Related