分类: LINUX
2010-03-17 08:58:52
1,添加自己的插件函数
(1)在/home/username/下建立一个文件夹 .vim/plugins 或 .vim/plugin
(2)添加两个文件
文件1
cat cs_search_string.vim
"cs search word
func CS_Search_Word()
let w = expand("")
exe "cs f s" w
exe "copen"
endfunc
" find the define
func CS_Search_define()
let w = expand("")
exe "cs f g" w
exe "copen"
endfunc
" find call what funcs
func CS_Search_whatfunc()
let w = expand("")
exe "cs f d" w
endfunc
" find called func
func CS_Search_calledfunc()
let w = expand("")
exe "cs f c" w
endfunc
" find where file the func is
func CS_Search_funcfiles()
let w = expand("")
exe "cs f i" w
endfunc
文件2
cat search_word.vim
"search word
func Search_Word()
let w = expand("")
exe "vimgrep" w "./**/*.c ./**/*.h"
exe "copen"
endfunc
(3)在自己的home目录下,建立自己的.vimrc
内容如下:
击(此处)折叠或打开