HJY bio photo

HJY

A Code Lover. Also good at cooking

Github

This is a small memo about how to use vim.

  1. The easiest way set up vim is to use other people’s configuration. For example, vimrc is very good and you should take a look.

  2. For Mac, install iterm2. The defualt terminal does not work very well with vim. To use the mouse, insert ‘set mouse=a’ in “.vimrs”.

  3. In vim, select text using mouse while pressing option key, then you can copy by CMD + C

  4. format all code: gg = G

  5. search / and stop searching :noh

  6. replace 0, $ s/a/b/gci

  7. tab can be used to autocomplete command

  8. useful pulgin: tag_list, TlistOpen, NERDTree, MRU, conque

  9. enter shell “:shell”