Monday, May 31, 2010

vim commands

map m w3dw$pj0

b back one word

cscope:

0 or s: Find this C symbol
1 or g: Find this definition
2 or d: Find functions called by this function
3 or c: Find functions calling this function
4 or t: Find this text string
6 or e: Find this egrep pattern
7 or f: Find this file
8 or i: Find files #including this file

nmap s :cs find s =expand("")
nmap g :cs find g =expand("")
nmap c :cs find c =expand("")
nmap t :cs find t =expand("")
nmap e :cs find e =expand("")
nmap f :cs find f =expand("")
nmap i :cs find i ^=expand("")$
nmap d :cs find d =expand("")


nmap s :vert scs find s =expand("")
nmap g :vert scs find g =expand("")
nmap c :vert scs find c =expand("")
nmap t :vert scs find t =expand("")


vi tips
http://rayninfo.co.uk/vimtips.html

Named buffer:
It is possible to copy or delete text from any file to a named buffer, and to keep as many as 26 of those buffers around for convenience. Buffers are created using lower case single letters. Using upper c
ase letter means append to the existing buffer. The command beginning buffer operation is " (double quotation mark). Following it is the name of the buffer and then description of the operation to be perf
ormed:

"ay} - yank (copy) from cursor to end of paragraph into buffer "a".
If buffer exists, overwrite it.
"A12d - delete 12 lines from cursor down and append it to the
existing buffer "a".
"ap - take contents of buffer "a" and paste it below cursor line.