80 likes | 220 Views
Vi IMproved. Quick guide to vim editor netj@sparcs.kaist.ac.kr. What ’ s vim?. Improved version of Vi editor vim = Vi IMproved Popular file editor in UNIX world Available for many OS. Getting Started. Run “ vi [filename] ” from your shell. Moving Cursor h : left j : down k : up
E N D
Vi IMproved Quick guide to vim editor netj@sparcs.kaist.ac.kr
What’s vim? • Improved version of Vi editor • vim = Vi IMproved • Popular file editor in UNIX world • Available for many OS
Getting Started • Run “vi [filename]” from your shell
Moving Cursor h : left j : down k : up l : right H : top L : bottom 0 : begin of line $ : end of line W, w : next word Input Mode a : append A : append at end i : insert I : insert at begin o : append line O : insert line R : replace mode [ESC] : exit input mode Basic Commands
Moving Cursor #2 gg : first line of file G : last line of file ^F : next page ^B : previous page ^D : next halfpage ^U : prev halfpage :<n> : goto line #<n> <n>[ENTR] : go down #<n> lines B, b : begin of word E, e : end of word Working with Screen v : visual V : visual line ^V : visual block ^E : scroll down ^Y : scroll up Job Control u : undo U : undo job ^R : redo Basic Commands #2
c<dir> : change <dir> C : change line Copy & Paste Y : copy line y<dir> : copy <dir> p : append paste P : insert paste Basic Commands #3 Delete & Insert • x : delete a char. • X : delete back char. • D : delete to EOL • dd : delete a line • r : replace a letter • s : delete a character and insert • S : delete a line and insert
Search & Substitute :s/<exp1>/<exp2>/ : substitute <exp1> with <exp2> /<exp>, :/<exp> : search <exp> forward ?<exp>, :?<exp> : search <exp> back n : next match N : previous match Write & Read :w : write file :e : edit file :q : quit vim :wq : write & quit ZZ : write & quit :x : write & quit :r : read file Basic Commands #4
More Information • man vim • :help in vim • Vim Website • http://www.vim.org