User Tools

Site Tools


simple_vi_vim_handling

This is an old revision of the document!


Simple vi/vim handling

Line numbers

Show line numbers:

:set nu

“Unshow” line numbers:

:set nonu

Vim show line numbers with F12 shortcut

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

nmap <F12> :set number!<CR>

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.1318666367.txt.gz · Last modified: 2011/10/15 08:12 by root