Skip to content

Instantly share code, notes, and snippets.

@xtbl
Last active August 29, 2015 14:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xtbl/0bef7bf01067106afc9c to your computer and use it in GitHub Desktop.
Save xtbl/0bef7bf01067106afc9c to your computer and use it in GitHub Desktop.
vim useful stuff
http://benfrain.com/learning-vim-front-end-coding-month/
http://dougblack.io/words/a-good-vimrc.html
http://vimawesome.com/
http://stackoverflow.com/questions/1218390/what-is-your-most-productive-shortcut-with-vim
Vim:
find a word: press escape and then /word
find the next word: press n or /
find the prev work: press ?
replace a word in the first 10 lines only: press :1,10s/word/newword/g
replace a word in the whole file: type :1.$s/word/newword/g
use yank (:startline, endline y) and put (p) to copy and paste blocks of text
use yank (:startline, endline y) and w!/tmp/filename to copy a section to a temp file and then move to where you want the file and use :r /tmp/filename to insert it.
moving around:
use arrows or hjkl keys to move left,up,down, right in the file
use w to skip ahead one word
use shiftA to skip to end of line and enter insert mode
use shiftG to skip to end of file
close tab/file :q or ZZ
NERDTree
CheatSheet http://www.cheatography.com/stepk/cheat-sheets/vim-nerdtree/
NERDTree jump between tree and file: ctrl-ww
NERDTree close tree window: q
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment