vimtutor.markdown
December 20, 2013 ยท View on GitHub
Lesson 2.3: On Operations and Motions
wis until the start of the next word, excluding its first character.eis until the end of the current word, including the last character.
Lesson 2.6: Operating on Lines
- In the command
dd, the seconddisn't a motion. It's just a shortcut by the vim designers.
Lesson 2.7: The Undo Command
- Typing a capital
Uwill undo all changes on a line. - Typing
Ctrl+Rwill redo the commands, or undo the undos.
Lesson 3.3: The Change Operator
- To change until the end of a word, type
ce.
Lesson 3.4: More Changes Using c
- The change operator accepts a number and a motion like
d.
Lesson 4.1: Cursor Location and File Status
- Typing
Ctrl+gwill display the filename and the position in the file. - Typing
ggwill move to the start of a file, and typingGmoves to the bottom.
Lesson 4.2: The Search Command
- Typing
Ctrl+owill jump to an older location. TypingCtrl+iwill jump to a newer location.
Lesson 4.4: The Substitute Command
- To substitute only on the current line, type
:s/old/new. - To substitute in a range of lines, type
:#,#s/old/new/g. - To find each occurrence and prompt for substitution, type
:%s/old/new/gc.
Lesson 5.3: Selecting Text to Write
- To save part of a file, select it in visual mode before executing
:w.
Lesson 5.4: Retrieving and Merging Files
- To insert the contents of a file, type
:r FILENAME.
Lesson 6.3: Another Way to Replace
- Type
Rto replace more than one character.
Lesson 6.4: Copy and Paste Text
- You can also use
yas an operator, e.g.ywyanks one word.
Lesson 6.5: Set Option
- If you want to ignore case for just one search command, use `/[term]\c.
Lesson 7.1: Getting Help
- Type
:helpto get help. Add an argument to get help on a particular subject.
Lesson 7.3: Completion
- Tab completion works for commands, as well as filenames following
:eor:w.