After reading the vimtutor, take the summary out and bring it together so that you can turn it on at any time.
If you have read the text, you'll forget the commands!
Although I followed it again, or not all, practice it, who makes me stupid.
But I think of a little help to remember the way, of course, everyone can have their own set, useful on the good.
Four directional keys:
Find out what each command represents in English, and guess what the author thought when defining the command. I think it's a bit of a favorite. previous brother gave a picture, I looked for the English version, the figure is more complete:
a append append after the cursora Append append after the end of line (EOL) i insert insert after the cursoro open open a line BELOW the cursorO Open open a line above the cursoru undo undo previous actionU undo undo all the changes on a linec change change from the cursor to Where the motion takes youc change change to the end Of a linee end move to the end of a wordy yank yanks ( Copies) text p paste puts (pastes) textr replace replace oneR replace replace until ESCd delete delete from the cursor to where the motion takes yous substitute Subsitute old with neww write write to fileq quit quit vim
Attached summary, convenient to review.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lesson 1 SUMMARY 1. The cursor is moved using either the arrow keys or the hjkl keys. h (left) j (down) k (UP) l (right) 2. to start vim from the shell prompt type: vim filename <ENTER> 3. To exit Vim type: <ESC> :q! <ENTER> to trash all changes. OR type: <ESC> :wq <ENTER> to save the changes. 4. to delete the character at the Cursor type: x 5. to insert or append text type: i type inserted text <esc>insert before the cursor a type appended text <ESC> append after the linenote: pressing <esc> will place you in normal mode or will cancel an unwanted and partially completed command. now continue with lesson 2.~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~ lesson 2 summary 1. to delete from the cursor up to the next word type: dw 2. to delete from the cursor to the end of a line type: d$ 3. to delete a whole line type: dd 4. To Repeat a motion prepend it with a number: 2w 5. The format for a change command is: operator [number] Motion where: operator - is what to do, such as d for delete [number] - is an optional count to repeat the motion motion - moves over the Text to operate on, such as w (Word), $ (to the end of line), etc. 6. to move to the start of the line use a zero: 0 7. To undo previous actions, type: u (lowercase u) to undo all the changes on a line, type: U ( capital u) to undo the undo ' s, type: ctrl-r~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ lesson 3 summary 1. to put back text that has just been deleted, type p . this puts the deleted text after the cursor (If a line was deleted it will go on the line below the cursor). 2. to replace the character under the cursor, type r and then the character you want to have there. 3. the change operator allows you to change from the cursor to where the motion takes you. eg. Type ce to change from the cursor to the end of the word, c$ to change to the end of a line. 4. the format for change is: c [number] motionnow go on to the next lesson.~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ lesson 4 summary 1. ctrl-g displays your location in the file and the file status. G moves to the end Of the file. number g moves to that line number. gg Moves to the first line. 2. typing /followed by a phrase searches forward for the phrase. typing ?followed by a phrase searches BACKWARD for the phrase. After a search type n to find the next occurrence in the same direction or N to Search in the opposite direction. ctrl-o takes you back to older positions, ctrl-i to newer positions. 3. Typing %while the cursor is on a (,), [,],{, or } goes to its match. 4. To substitute new for the first old in a line type :s/old/new To substitute new for all ' old ' s on a line type :s/old/new/g to substitute phrases between two line # ' s type :#, #s/old/new/g to substitute all occurrences in the file type :%s/old/new/g to ask for confirmation each time add ' C ' :%s/old/new/gc~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ lesson 5 SUMMARY 1. :!command executes an external command. Some useful examples are: (MS-DOS) (Unix) :!dir :!ls - shows a directory listing. :!del filename :!rm filename - removes file filename.&nbSp; 2. :w filename writes the current vim file to disk with name FILENAME. 3. v motion :w filename saves the visually selected lines in file filename. 4. :r filename retrieves disk file FILENAME and puts it below the cursor position. 5. :r !dir reads the output of the Dir command and puts it below the cursor position.~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ lesson 6 summary 1. type o to open a line&nbsP below the cursor and start insert mode. type o to open a line above the cursor. 2. type a to insert text AFTER the cursor. type a to insert text after the end of the line. 3. The e command moves to the end of a word. 4. the y operator yanks (copies) text, p puts (Pastes) it. 5. Typing a capital r enters replace mode until <esc> is pressed. 6. Typing ": set xxx" sets the option "xxx". some options are: &nbSP; ' IC ' ' ignorecase ' ignore upper/lower case when searching ' is ' ' Incsearch ' show Partial matches for a search phrase ' HLS ' ' Hlsearch ' highlight all matching phrases you can either use the long or the short option name. 7. prepend "No" to switch an option off: :set noic~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~ lesson 7 summary 1. type :help or press <f1> or
Vim Learning Note-vimtutor