{{tag>en en:linux en:client en:shell}} ====== Vi ====== Some hints and tips for vi/vim. ===== Simple edition ===== * Go to line NNN :NNN * Cut NNN lines NNNdd * Copy NNN lines NNNyy * Paste p * Undo u * Redo CTRL+r * Repeat last modification . ===== Search and replace ===== * replace a word : cw * Search/Replace : the following line replace string1 to string2 between linges start and end (1,$ modify all the doc) start,end s/string1/string2/g ===== Save/Quit ===== * save :w * save & quit :x :wq * quit without saving :q! ===== Advanced ===== * Disable auto indentation (useful when pasting text block) : :set noai :set noautoindent * File conversion :set ff=unix :set encoding=utf-8 :set fileencoding=utf-8 ===== Links ===== * http://www.eisti.fr/~bp/doc/viavance.html