May 16, 2006

VIMRC

Some Useful VIMRC Definitions:

function! ShowFunc()
let oldmake= &makeprg
let &makeprg= 'listfunc'

silent! make%
cwindow

let &makeprg=oldmake
endfunc

"To enable restoring (for an xterm):
"set t_ti=^[7^[[r^[[?47h t_te=^[[?47l^[8
"(Where ^[ is an , type CTRL-V to insert it)
set t_ti=^[7^[[r^[[?47h
set t_te=^[[?47l^[8

set ignorecase
"map j_
"map k_
"set wmh=0
map ^[j j
map ^[k k

map :cn
map :cp
map :grep * -r :cw :set syntax=off k
map :on
map :w :make :cw
map :call ShowFunc()

augroup filetypedetect
au! BufRead,BufNewFile *.inc setfiletype make
augroup END

" Automatically reload .vimrc when changing
autocmd! bufwritepost .vimrc source %

============================
The listfunc script:
#!/bin/sh
ctags -x --c-types=f -u $1 | gawk '{printf("%s:%s: %s\n",$4,$3,$1) > "/dev/stderr"}'

No comments:

Post a Comment