Text Objects

The commands that start with “a” select “a”n object including white space, the commands starting with “i” select an “inner” object without white space, or just the white space. Thus the “inner” commands always select less text than the “a” commands.

  • as: “a sentence”
  • is: “inner sentence”
  • ap: “a paragraph”
  • ip: “inner paragraph”

Also w and W for words, t for HTML tags, and any pair of symbols: (<{"'[.

Macro Tricks

va{V can be used to select the outer block line-wise.

Scrolling

z., zt, zb move "cursor line" into respective position
H, L, M move cursor to respective position

Marks

m followed by a letter sets a mark. a lowercase letter is local to the current buffer, but an uppercase letter can jump between files.

' followed by a letter jumps to the respective mark.

Removing Auto-Inserted Comment Leader

After pressing Enter or ‘o’, use CTRL-U to remove the comment leader. See :help fo-table.

o       Automatically insert the current comment leader after hitting 'o' or
        'O' in Normal mode.  In case comment is unwanted in a specific place
        use CTRL-U to quickly delete it. i_CTRL-U

Visual-block edits

With a blockwise selection, A{string} will append string to end of block on every line of the block, I{string} will insert string at the start of block on every line of the block.

To paste lines of text to the end of a blockwise selection, first make a blockwise selection of the text to copy and yank it, then insert a placeholder character after the end of block on each line, select the placeholder row and press p or P. Both would delete the placeholder column (end of block) and insert text there.