Skip to content

Instantly share code, notes, and snippets.

@mufasa71
Last active August 29, 2015 14:06
Show Gist options
  • Save mufasa71/5cc95f5343235a5827cc to your computer and use it in GitHub Desktop.
Save mufasa71/5cc95f5343235a5827cc to your computer and use it in GitHub Desktop.
  • <Leader>sr - change word under cursor (global in project)
  • <Leader>ss - change word under cursor
  • <Leader>f - find word under cursor in current buffer (fuzzy logic)
  • ``.` - position of last change
  • ``^` - position of last insert
  • gf - jump to the filename under cursor
  • ^] - jump to the definition
  • m<Upper Letter> - global mark
  • ``[` - jump to begin of selection
  • gp - select paster text
  • :r[ead] !date - insert result of ex. command
  • ie ae - text object as entire buffer (with vim-textobj-entire installed)

Substitute across files with ag a.k.a. Silver Searcher

:argdo %s/MyAwesomeApp/TodoApp/gc | w
:args `ag -l 'pattern' .`
:Ag! {pattern}

vimdiff and folding

  • do - Get changes from other window into the current window
  • dp - Put the changes from current window into the other window
  • ]c - Jump to the next change
  • [c - Jump to the previous change
  • :diffupdate- recalculate the diff
  • zo - open fold
  • zc - close fold
  • zr - reducing folding level
  • zm - one more folding level, please
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment