windows下也可以使用vim,有些时候可能需要。
这和应用于linux下稍微有些不同,我在此稍微记录一下,写的不详细,但是看过我写的vim菜鸟学习基础篇和中级篇之后,应该可以看懂。
1. 安装:
ctags 并将它加入到环境变量path中
Cscope on Win32 并将它加入到环境变量path中, 且将cscope_maps.vim拷贝到vimplugin (解释一下,cscope_maps.vim在cscope官网下载,Cscope on win32是一个cscope在windows下应用的项目)
将cctree拷贝到vimplugin
将nerdtree两个plugin文件夹下的东东拷贝到vimplugin
将taglist拷贝到vimplugin
2. 配置:
taglist设置c和c++语言选项:
;p:externAndforwardfunction;x:externAndforwardVariable
CCTree设置显示深度:
CCTreeRecursiveDepth = 0
CCTreeMinVisibleDepth = 0
vim设置:
let Tlist_Show_One_File='1'
let Tlist_Sort_Type='name'
nnoremap <F3> :TlistToggle<CR>
let NERDTreeWinPos='right'
nnoremap <F2> :NERDTreeToggle<CR>
set guifont=Courier_new:h11
set guifontwide=新宋体:h11
set encoding=utf-8
set fileencodings=utf-8,chinese,latin-1
if has("win32")
set fileencoding=chinese
else
set fileencoding=utf-8
endif
"解决菜单乱码
source $VIMRUNTIME/delmenu.vim
source $VIMRUNTIME/menu.vim
"解决consle输出乱码
language messages zh_CN.utf-8
3. 使用方法:
ctags -R --c-kinds=+px --c++-kinds=+px
cscope -Rb
:CCTreeLoadDB cscope.out