Vim

Just some hints which might be useful for vim users

Movements

  • To move the cursor to the beginning of the document, type ´gg´
  • To move the cursor to the end of the document, type ´G´
  • To move the cursor to line 20, type ´20gg´
  • To move the cursor to the end of the paragraph, type ´{´ To move it to the beginning, type ´}´
  • To move the cursor to the end of a sentence, type ´(´ To move it to the beginning, type ´)´

Reformat Text

  • To reformat a paragraph, go to the beginning of the pagraph and type ´gq{´
  • To reformat the whole document, type ´ggVGgq´

Substitutions

  • To substitute every occurrence of string ‘from’ with string ‘to’ in a file, type ´:%s/from/to/g´

Color Scheme

The default colorscheme (on Gentoo) for vimdiff (or vim -d) is unusable. The elflord color scheme is better. In vim, type

:colorscheme elflord
 
wiki/vim_tips.txt · Last modified: 27.03.2007 10:43 by eglimi
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki