1 新增如下配置
所有用户生效的路径:/etc/vim/vimrc
当前用户生效:$HOME/.vimrc
"-------------------- key map<Add by liguang 20180618> --------------------"
inoremap [ []<Esc>i
inoremap ] []<Esc>i
inoremap ( ()<Esc>i
inoremap ) ()<Esc>i
inoremap { {<CR>}<Esc>O
inoremap } {<CR>}<Esc>O
inoremap < <><Esc>i
inoremap " ""<Esc>i
inoremap ' ''<Esc>
"-------------- ctag configuration<Add by guang 20180618> ------------------"
set tags=tags;
set autochdir
"--------------- taglist configuration<Add by guang 20180618> ---------------"
nmap tl :Tlist<CR>
let Tlist_Show_One_File = 1
let Tlist_Exit_OnlyWindow = 1
let Tlist_File_Fold_Auto_Close = 1
let Tlist_Auto_Open = 1
let Tlist_Process_File_Always=1
"------------- winmanager configuration<Add by guang 20180618> --------------"
nmap wm :WMToggle<CR>
let g:winManagerWindowLayout='FileExplorer|TagList'
nmap lu :FirstExplorerWindow<cr>
nmap lb :BottomExplorerWindow<CR>
"-------------- cscope configuration<Add by guang 20180618> -----------------"
set cscopequickfix=s-,c-,d-,i-,t-,e-
2 下载ctags安装包
路径:http://ctags.sourceforge.net/
3 解压并编译ctags
tar -zxvf ctags-xx.tar.gz
./configure
make
make install
sudo make install
ctags --version
4 ctags配置
所有用户生效的路径:/etc/vim/vimrc,如上,步骤1已经添加
set tags=tags;
set autochdir
5 taglist配置
路径:https://sourceforge.net/projects/vim-taglist/files/
unzip taglist_46.zip
拷贝解压后的taglist.txt到目录:/usr/share/vim/vim74/doc
拷贝解压后的taglist.vim到目录:/usr/share/vim/vim74/plugin
/etc/vim/vimrc添加如下内容,步骤1已经添加
nmap tl :Tlist<CR>
let Tlist_Show_One_File = 1
let Tlist_Exit_OnlyWindow = 1
let Tlist_File_Fold_Auto_Close = 1
let Tlist_Auto_Open = 1
let Tlist_Process_File_Always=1
5 winmanager配置
路径:https://www.vim.org/scripts/script.php?script_id=95
和taglist配置一样的操作,将winmanager解压以后,加压后的文件参考taglist拷贝到对应目录,/etc/vim/vimrc添加内容参考步骤1
6 cscope安装配置,和ctags一样,完全参照ctags
路径:http://cscope.sourceforge.net
./configure
make
make install
ctrl+d 退出cscope
报错解决:
gcc -DHAVE_CONFIG_H -I. -I.. -g -O2 -MT build.o -MD -MP -MF .deps/build.Tpo -c -o build.o build.c
build.c:52:20: fatal error: curses.h: No such file or directory
#include <curses.h>
^
compilation terminated.
make[2]: *** [build.o] Error 1
make[2]: Leaving directory `/home/guang/develop/plugin/cscope-15.8b/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/guang/develop/plugin/cscope-15.8b'
make: *** [all] Error 2
解决:
$ sudo apt-get install libncurses5-dev libncursesw5-dev
报错解决:
/home/guang/develop/plugin/cscope-15.8b/src/input.c:260: undefined reference to `wredrawln'
collect2: error: ld returned 1 exit status
make[2]: *** [cscope] Error 1
make[2]: Leaving directory `/home/guang/develop/plugin/cscope-15.8b/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/guang/develop/plugin/cscope-15.8b'
make: *** [all] Error 2
解决:安装完成libncurses5-dev后,再执行一遍如下步骤:
./configure
make
make install