Skip to content

Instantly share code, notes, and snippets.

@narath
Forked from bostonaholic/vim-cheatsheet.md
Last active April 20, 2016 17:15
Show Gist options
  • Save narath/bcd738aa379023f386be0ea5531116e5 to your computer and use it in GitHub Desktop.
Save narath/bcd738aa379023f386be0ea5531116e5 to your computer and use it in GitHub Desktop.
VIM

VIM MOVEMENT

BASIC Movement (Screencast 1)

h - left j - down k - up l - right

0 - end of line $ - start of line

w - next word W - next word by whitespace e - end of next word E - end of next word by whitespace b - beginning of previous word B - beginning of previous word by whitespace ge - end of previous word gE - end of previous word by whitespace

f<char> - next

  • repeat with ; F<char> - previous
  • repeat with ; t<char> - until
  • repeat with l; T<char> - previous until
  • repeat with l;

BASIC Movement (Screencast 2)

^f - forward full page ^b - backward full page ^u - up half page ^d - down half page

H - head of screen M - middle of screen L - last of screen

gg - top of file G - bottom of file <num>G - line

* - search forward current word # - search backward current word g* - search forward current word without word boundary g# - search backward current word without word boundary

/<str> - search forward for ?<str> - search backward for

BASIC Movement (Screencast 3)

]] - jump to next { in column 0 [[ - jump to previous { in column 0 ][ - jump to next closing brace in column 0 [] - jump to previous closing brace in column 0

  • hint: going forward hit right key first going backward hit left key first % - jump to matching { }, [ ], ( )

ma - mark a line 'a - jump to last mark line ``a- jump to last mark line and column''` - jump to last location

To split lines at a period:

select the paragraph to split use vap

:s/\(\d\)\. /^M\1./g  

Note to get the ^M, you need to press

Credits: Stackoverflow

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