Skip to content

Instantly share code, notes, and snippets.

@jonchretien
Last active August 29, 2015 14:13
Show Gist options
  • Save jonchretien/e9e858d1df5952df40e2 to your computer and use it in GitHub Desktop.
Save jonchretien/e9e858d1df5952df40e2 to your computer and use it in GitHub Desktop.
VIM Snippets

Vim Snippets

Jump to line start

  • I ("Insert", editing mode)

Jump to line end

  • $ (non-editing mode)
  • A ("Append", editing mode)

Indent multiple lines

Use the > command. To indent 5 lines, 5>>. To mark a block of lines and indent it, Vjj> to indent 3 lines (vim only). To indent a curly-braces block, put your cursor on one of the curly braces and use >%.

If you’re copying blocks of text around and need to align the indent of a block in its new location, use ]p instead of just p. This aligns the pasted block with the surrounding text.

Also, the shiftwidth setting allows you to control how many spaces to indent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment