VIM之ctags & Taglist 插件

VIM之ctags & Taglist 插件

1. 我的界面

2. ctags

  • exuberant ctags是一般linux系统上缺省的ctags
  • 我的ctags版本:Exuberant Ctags 5.9~svn20110310

简单介绍

  • Used in at least 50 countries in all 7 continents (including Antarctica!)
  • Supports 41 programming languages
  • Featured in the book, Learning the vi Editor, a title in the O'Reilly series
  • Covered in the March 2001 issue of C++ Users Journal, "Navigating Linux Source Code"
  • Praised in the Weekend Mechanic column of the June 1997 issue of Linux Gazette
  • Praised in Perl Buzz
  • Freely available under the terms of the GNU General Public License
  • Included in major Linux distributions

安装方式

sudo apt-get install exuberant-ctags

.vimrc配置

""""""""""""""""""""""""""""""""""
"plugin-->ctags(exuberant-ctags)
""""""""""""""""""""""""""""""""""
set tags=tags
set autochdir

3. taglist

我的taglist版本:4.6

下载

taglist_46.zip
http://www.vim.org/scripts/script.php?script_id=273

安装

  • 解压:得到doc和plugin两个文件夹

  • 转移:

//the version of vim on my linux is 7.4
sudo cp doc/taglist.txt /usr/share/vim/vim74/doc/
sudo cp plugin/taglist.vim /usr/share/vim/vim74/plugin/
  • .vimrc配置
""""""""""""""""""""""""""""""""""
"plugin-->taglist
""""""""""""""""""""""""""""""""""
let Tlist_Auto_Open=1 "auto open Tlist
let Tlist_Exit_OnlyWindow = 1 "exit Tlist if close sourse file
let Tlist_Show_One_File = 1 "only show current file's Tlist
let Tlist_Compact_Format=1 "Hide help menu
let Tlist_Ctags_Cmd = '/usr/bin/ctags' 

taglist命令

ctrl + ww     taglist与代码窗口的切换
<CR>          跳到光标下tag所定义的位置,用鼠标双击此tag功能也一样
o             在一个新打开的窗口中显示光标下tag
<Space>       显示光标下tag的原型定义
u             更新taglist窗口中的tag
s             更改排序方式,在按名字排序和按出现顺序排序间切换
x             taglist窗口放大和缩小,方便查看较长的tag
+             打开一个折叠,同zo
-             将tag折叠起来,同zc
*             打开所有的折叠,同zR
=             将所有tag折叠起来,同zM
[[            跳到前一个文件
]]            跳到后一个文件
q             关闭taglist窗口
<F1>          显示帮助
原文地址:https://www.cnblogs.com/Star_Sky/p/6514556.html