vimrc

set nocompatible
syntax on
filetype on
""set background=dark
set autoindent
set smartindent
set showmatch
set number
set tabstop=4
set vb t_vb=
set nowrap
set hlsearch
set incsearch
set backspace=indent,eol,start whichwrap+=<,>,[,]

:colorscheme asmanian2

map <F4> :silent! NERDTree<CR>

map <F3> :silent! Tlist<CR>
let Tlist_Ctags_Cmd='ctags'
let Tlist_Use_Right_Window=1
let Tlist_Show_One_File=0
let Tlist_File_Fold_Auto_Close=1
let Tlist_Exit_OnlyWindow=1
let Tlist_Process_File_Always=0
let Tlist_Inc_Winwidth=0

map <F12> :call Do_CsTag()<CR>
nmap <C-@>s :cs find s <C-R>=expand("<cword>")<CR><CR>:copen<CR>
nmap <C-@>g :cs find g <C-R>=expand("<cword>")<CR><CR>
nmap <C-@>c :cs find c <C-R>=expand("<cword>")<CR><CR>:copen<CR>
nmap <C-@>t :cs find t <C-R>=expand("<cword>")<CR><CR>:copen<CR>
nmap <C-@>e :cs find e <C-R>=expand("<cword>")<CR><CR>:copen<CR>
nmap <C-@>f :cs find f <C-R>=expand("<cfile>")<CR><CR>:copen<CR>
nmap <C-@>i :cs find i ^<C-R>=expand("<cfile>")<CR>$<CR>:copen<CR>
nmap <C-@>d :cs find d <C-R>=expand("<cword>")<CR><CR>:copen<CR>
function Do_CsTag()
    let dir = getcwd()
	    if filereadable("tags")
			let tagsdeleted=delete("./"."tags")
			if(tagsdeleted!=0)
	       		 echohl WarningMsg | echo "Fail to do tags! I cannot delete the tags" | echohl None
	       		 return
		    endif
	    endif


	    if has("cscope")
	        silent! execute "cs kill -1"
	    endif


	    if filereadable("cscope.files")
	        let csfilesdeleted=delete("./"."cscope.files")
	        if(csfilesdeleted!=0)
	          echohl WarningMsg | echo "Fail to do cscope! I cannot delete the cscope.files" |    echohl None
           return
	        endif
																																				    endif
	    if filereadable("cscope.out")
            let csoutdeleted=delete("./"."cscope.out")
	        if(csoutdeleted!=0)
           echohl WarningMsg | echo "Fail to do cscope! I cannot delete the cscope.out" |    echohl None
           return
																																        endif
	    endif

	    if(executable('ctags'))
	        "silent! execute "!ctags -R --c-types=+p --fields=+S *"
	        silent! execute "!ctags -R --c++-kinds=+p --fields=+iaS --extra=+q ."
	    endif
	    if(executable('cscope') && has("cscope") )
	    silent! execute "!find . -name '*.h' -o -name '*.c' -o -name '*.cpp' -o -name '*.java' -o -name '*.cs' > cscope.files"
	    silent! execute "!cscope -b"
	    execute "normal :"
		if filereadable("cscope.out")
	     execute "cs add cscope.out"
	    endif
	    endif
		redraw!
	endfunction


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值