VIM Advanced
Why VIM? Easy to study Much easy to use Very easy to find from host You can defined it for yourself You can save time Your hand will not be tired for long typing
Three Modes Input mode Command mode ex mode
Basic Motion –h, j, k, l, ^, $ –w, W, b, B –-, +, G, gg, % Delete - x, X, d, dd, D, J Insert - a, A, i, I, o, O, :r Undo and Redo - u, o
Chage Delete and Insert –r, R, c, cc, C, s, S, ~ Shift –, >> (shiftwidth) Filter –!, !!, =, == (equalprg) Regular Expressiong –:s/pattern/string/modifier
Yank and Paste Register, [ “ x] :reg, y, yy, Y, p, P Predefined registers –“. - last inserted text –“ % - current filename –“ : - recent excuted command-line
Repeat simple repeat -. complex repeat –q[0-9a-zA-Z] –q
Remain Visual – v, V, ctrl-v :nu, :sh, :!{cmd}, :!!, :h
Compile and Error check :mak[e] – execute `makeprg ’ :gr[ep] – execute `grepprg ’ Display error –:cc [nr] – [nr] or current error –:cn – next error –:cp, :cN – previous error –:cnf – first error –:cf [nr] – [nr] or first error –:cla [nr] – [nr] or last error –:cl – list all error
Windows :sp, :new, :clo, :on ctrl w + –j, k, t, b – move to other window –r, R – rotation –x – exchange –-, =, + (:res [-+]N) – resize :qa, :wa
Indenting and Syntax highlighting :set autoindent :set smartindent :set cindent :syntax on :set syntax=perl :set background=[dark|light]
Various option autowrite – automatically write fileencoding – korea fileformat – dos, unix, mac textwidth – for writing mail –:set tw=78 autocmd – see the example :help gzip-example
Tab size issue First –:set tabstop=4 Second –:set tabstop=8 –:set softtabstop=4 –:set shiftwidth=4
Links
References :help