Monday, October 1, 2012

Vi/VIM

To insert characters on the beginning of a line. Example, insert // from line 1 to 10

 :1,10s!^!//! 


Sample in creating folding in vim. Insert #{{{ text here #}}} provided everything was properly setup on vimrc


~/workspace/puppetworks $ cat site.pp
node 'chrisp.lab.local' {#{{{




}#}}}



pressing zc will close the folded texts


+-- 6 lines: node 'chrisp.lab.local' {#----------------------------------------------------------------------------


ref: http://www.linux.com/learn/tutorials/442438-vim-tips-folding-fun