User Tools

Site Tools


simple_vi_vim_handling

This is an old revision of the document!


Simple vi/vim handling

Add show/unshow line numbering in vim (F12 key) Add following to /etc/vimrc

nmap <F12> :set number!<CR>

Line numbers

Show line numbers:

:set nu

“Unshow” line numbers:

:set nonu

Search and replace

Current line = .

Insert comment character on current and next 5 lines:

:.,+5s/^/#/g

Change all appearances of from to morf from line 1 to current line:

:1,.s/from/morf/g 
simple_vi_vim_handling.1318666152.txt.gz · Last modified: 2011/10/15 08:09 by root