index.sh
#!/bin/bash
echo "delete cscope.files, cscope.out, tags"
rm -f cscope.files cscope.out tags
echo "create cscope.files"
find `pwd` -name '*.h' -o -name '*.c' -o -name '*.S'> cscope.files
echo "cscope add cscope.files"
cscope -Rbkq -i cscope.files
echo "create tags"
ctags --languages=c --langmap=c:+.h --extra=+q -R
vimrc部分内容
set number
set autochdir
set tags=tags;
cs add cscope.out
"配置nerdtree使用F3打开关闭
map <F2> :NERDTreeMirror <CR>
map <F2> :NERDTreeToggle <CR>
"NERDTree配置
let NERDChristmasTree=1 "显示增强
let NERDTreeAutoCenter=1 "自动调整焦点
let NERDTreeShowFiles=1 "显示文件
let NERDTreeShowLineNumbers=1 "显示行号
let NERDTreeHightCursorline=1 "高亮当前文件
let NERDTreeShowHidden=0 "显示隐藏文件
let NERDTreeMinimalUI=0 "不显示'Bookmarks' label 'Press ? for help'
let NERDTreeWinSize=31 "窗口宽度
"配置Supertab
"let g:SuperTabRetainCompletionType=2 "记住上次的补全方式,直到按Esc退出插入模式位置
"let g:SuperTabDefaultCompletionType="<c-x><c-o>" "按下tab后默认补全方式为<c-p>,现在改为<c-x><c-o>
"默认最大化窗口打开
au GUIEnter * simalt ~x
"taglist配置信息
"设置taglist打开关闭的快捷键F8
noremap <F1> :TlistToggle<CR>
"更新ctags标签文件快捷键设置
noremap <F<F3>> :!ctags -R<CR>
let Tlist_Auto_Open=1 " Let the tag list open automatically
let Tlist_Auto_Update=1 " Update the tag list automatically
let Tlist_Compact_Format=1 " Hide help menu
let Tlist_Ctags_Cmd='ctags' " Location of ctags
let Tlist_Enable_Fold_Column=0 "do show folding tree
let Tlist_Process_File_Always=1 " Always process the source file
let Tlist_Show_One_File=1 " Only show the tag list of current file
let Tlist_Exit_OnlyWindow=1 " If you are the last, kill yourself
let Tlist_File_Fold_Auto_Close=0 " Fold closed other trees
let Tlist_Sort_Type="name" " Order by name
let Tlist_WinWidth=30 " Set the window 40 cols wide.
let Tlist_Close_On_Select=1 " Close the list when a item is selected
let Tlist_Use_SingleClick=1 "Go To Target By SingleClick
let Tlist_Use_Right_Window=0 "在右侧显示
问题:按照网上的方法下载软件包然后解压安装vim插件后,输入命令时还是出现了
E492: Not an editor command: TlistToggle :
原因:插件没有安装好,后来上网找了一个更简单的安装插件的方法:
sudo apt-get install vim-scripts
然后想安装什么插件都可以输入以下命令:
vim-addons install taglist
vim-addons install supertab
vim-addons install cscope
vim-addons install winmanager
vim-addons install tags
然后修改相应的配置就行了,如果找不到~/.vimrc可以在vi /etc/vim/vimrc中修改