vimvim vundle taglistt插件怎么配置

vim常用插件_百度文库
两大类热门资源免费畅读
续费一年阅读会员,立省24元!
vim常用插件
上传于||文档简介
&&p​h​p​,​t​a​g​l​i​s​t​,​n​d​r​e​t​r​e​e​,​v​i​m​插​件​,​v​i​m​,​i​d​e​开​发​,​i​d​e
阅读已结束,如果下载本文需要使用
想免费下载本文?
你可能喜欢这篇文章还是承接了上一篇的内容.
上一篇讲述了一些基本的vim配置方法,现在讲述些我用到的插件和安装方法.
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
在完成了前面的配置之后,我们的vim应该已经很好用了.不过还是有些问题没有解决.没有自动补全.
这时候就要出马啦.
1. omni complete
omni complete是一个很好用的自动补全工具,支持很多语言,能自动的进行一些补全.在编译安装了vim73后,就自带了.我们要在vimrc下打开
filetype plugin on
set ofu=syntaxcomplete#Complete
第一句是关闭兼容模式,第二句则是打开匹配文件类型.一定要加上
打开了之后,就能发现很多代码可以自动补全了.比如css,html等都能很好的工作,
使用方法是&ctrl+x&&ctrl+o&
不过这还是不够,对于c/c++程序员来说,我们还需要更强大的工具.类成员变量,类的方法也要补全出来!
所以omnicppcomplete就登场了
cp omnicppcomplete-0.41.zip ~/.vim
unzip omnicppcomplete-0.41.zip
之后打开vimrc,添加下列几段
" OmniCppComplete
set completeopt=menu,longest,menuone
let OmniCpp_NamespaceSearch = 2
let OmniCpp_GlobalScopeSearch = 1
let OmniCpp_ShowAccess = 1
let OmniCpp_ShowPrototypeInAbbr = 1
let OmniCpp_MayCompleteDot = 1
let OmniCpp_MayCompleteArrow = 1
let OmniCpp_MayCompleteScope = 1
let OmniCpp_DefaultNamespaces = ["std", "_GLIBCXX_STD"]
let OmniCpp_SelectFirstItem = 2
let OmniCpp_DisplayMode=1
au CursorMovedI,InsertLeave * if pumvisible() == 0|silent! pclose|endif
再次打开vim,omnicpp就安装上了.
不过,这类成员变量还是不出来啊.
原来omnicpp利用的是tag来判断的,因此我们需要利用ctags来生成
首先要保证机器里有ctags,而且最好要5.4以上.好像是之前的有bug.
进入所在的cpp的目录,
ctags --c-kinds=+px --c++-kinds=+px --fields=+iafksS --extra=+qf your_file.cpp
这会生成一个tag文件,打开vim,运行
:set tags += tags
就会加载了.
使用的时候,在遇到-&和.的时候就会自动弹出.
不过吧,这样还是麻烦.每次还得自己运行一遍ctags,然后把tags加载进来,而且,那意味着我们的有些库的头文件也不能自动补全么?
首先是自动加载tags,在vimrc中加入
set tags+=tags
set tags+=/home/summer/tags/lib_tags
对于我们平常用到的头文件,可以自己手动生成一份,放到固定的文件夹下,之后写代码就方便了.
比如我的lib_tags就是编译了linux的头文件生成的
ctags --c-kinds=+px --c++-kinds=+px --fields=+iafksS --extra=+qf -R /usr/include/*
有了这个tag,还可以发挥vim的跳转功能.记得--extra一定要+f,这样遇到头文件我们也能跳转进头文件了.
另外我加入了当前目录下的tags,这样当我们生成一个tag之后,vim就回自动加载了.
而对于自动生成tags.事实上,还有人写了一个方便的工具,下面介绍
2. omnitags
这个是国人写的vim插件,下载地址
下载最新的版本放到~/.vim/plugin目录下即可.
再修改vimrc
nmap &silent&&leader&t :OmniTagsLoad ./tags&CR&
nmap &leader&u :OmniTagsUpdate
重启vim,在需要自动生成tags的时候,首先加载
//如果提示没有tag,则会要求创建,选择y即可
&leader&u your_files
//即可把该文件加入到本目录的tag中,
//之后凡是用:w保存,tag都会被更新
现在,配合起omnicppcomplete,写代码就很方便了.
不过感觉提示还是不智能,而且每次要补全了还得自己手动按ctrl+x ctrl+o.不爽不爽
3. autocomplpop
这个插件就是解决我们的烦恼的
cp vim-autocomplpop.zip ~/.vim
unzip vim-autocomplpop.zip
这个插件非常强大,自动弹出也满足了我们很多功能.比如自动弹出文件路径等等.
这个插件的默认是keyword completion.而由于咱们已经有了omnicppcomplete,所以其实就够了.
其对于keyword的补全实力非常强大.不过可能有人觉得,还是全部都用omni comp比较好.
于是就在网上搜了这么一段代码
let g:AutoComplPop_Behavior = {
\ 'c': [ {'command' : "\&C-x&\&C-o&",
\ 'pattern' : ".",
\ 'repeat' : 0}
事实上这个是没有用的,要想使用的话,有两个方式
1. 下载2.6或者更老版本的autocomplpop
从2.7开始,autocomplpop就修改了配置方式,所以之前老的版本已经无效了
2. 修改写法
let g:acp_behavior = {
'command' : "\&C-x&\&C-o&",
'meets': mycppfunc
'repeat':0
在~/.vim/autoLoad/acp.vim中增加函数
照着里头acp#meetsForKeyword的函数写就可以了..
function mycppfunc(context)
endfunction
不过这个在项目大了之后非常非常慢,所以不大推荐.默认的方法就挺好.效率也很高
4. NERDTreeToggle
这个是一个显示文件树形结构的插件,挺方便,一般大家也用
老方法,cp后unzip在~/.vim下即可
在vimrc下加入下面语句
nmap &F2& :NERDTreeToggle&CR&
以后按F2就可以掉出来,很方便
5. taglist
taglist是利用ctags来读取目前文件下的函数列表,变量等,很方便,推荐使用
还是cp后unzip在~/.vim就可以使用了
在vimrc下加入
let Tlist_Ctags_Cmd='~/bin/ctags' //这个修改成安装ctags的目录
let Tlist_Show_One_File=1
let Tlist_OnlyWindow=1
let Tlist_Use_Right_Window=0
let Tlist_Sort_Type='name'
let Tlist_Exit_OnlyWindow=1
let Tlist_Show_Menu=1
let Tlist_Max_Submenu_Items=10
let Tlist_Max_Tag_length=20
let Tlist_Use_SingleClick=0
let Tlist_Auto_Open=0
let Tlist_Close_On_Select=0
let Tlist_File_Fold_Auto_Close=1
let Tlist_GainFocus_On_ToggleOpen=1
let Tlist_Process_File_Always=1
let Tlist_WinHeight=10
let Tlist_WinWidth=45
let Tlist_Use_Horiz_Window=0
nmap &F3& :Tlist&CR&
之后就可以使用F3调出来了
vim对于c++的高亮提示的不好,尤其是stl很多方法和容器都没有高亮,看着很是郁闷,这时候stl就派上用场了
有了这个,vim就能对stl进行高亮了.
$ mkdir -p ~/.vim/after/syntax/cpp&$ cp stl.vim ~/.vim/after/syntax/cpp/
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
差不多把自己目前用的都介绍了.
vim用好了很强大,并不比很多IDE差.同时,由于环境限制,有的时候只能在终端下进行编程,VIM的重要性就体现出来了.用好了能很快提高开发效率.
目前笔者仅仅使用了这几款插件.觉得很好用,如果大家还有推荐的话,可以分享下.
阅读(...) 评论()taglist.vim : Source code browser (supports C/C++, java, perl, python, tcl, sql, php, etc)
&script karma&
Downloaded by 288137
&Comments, bugs, improvements&
created by
script type
description
The &Tag List& plugin is a source code browser plugin for Vim and
provides an overview of the structure of source code files and allows
you to efficiently browse through source code files for different
programming languages.&&You can visit the taglist plugin home page for
more information:
You can subscribe to the taglist mailing list to post your questions
or suggestions for improvement or to report bugs. Visit the following
page for subscribing to the mailing list:
For more information about using this plugin, after installing the
taglist plugin, use the &:help taglist& command.
install details
1. Download the taglist.zip file and unzip the files to the $HOME/.vim or the
&&&&$HOME/vimfiles or the $VIM/vimfiles directory. After this step, you should
&&&&have the following two files (the directory structure should be preserved):
&&&&&&&& plugin/taglist.vim - main taglist plugin file
&&&&&&&& doc/taglist.txt&&&&- documentation (help) file
&& Refer to the |add-plugin|, |add-global-plugin| and |runtimepath| Vim
&& help pages for more details about installing Vim plugins.
2. Change to the $HOME/.vim/doc or $HOME/vimfiles/doc or $VIM/vimfiles/doc
&&&&directory, start Vim and run the &:helptags .& command to process the
&&&&taglist help file. Without this step, you cannot jump to the taglist help
&&&&topics.
3. If the exuberant ctags utility is not present in your PATH, then set the
&&&&Tlist_Ctags_Cmd variable to point to the location of the exuberant ctags
&&&&utility (not to the directory) in the .vimrc file.
4. If you are running a terminal/console version of Vim and the terminal
&&&&doesn't support changing the window width then set the
&&&&'Tlist_Inc_Winwidth' variable to 0 in the .vimrc file.
5. Restart Vim.
6. You can now use the &:TlistToggle& command to open/close the taglist
&&&&window. You can use the &:help taglist& command to get more information
&&&&about using the taglist plugin.
rate this script
Life Changing
Unfulfilling&
script versions ()
Click on the package to download.
1. Fixed a bug in refreshing the folds in the taglist window when switching between Vim tabs with Tlist_Show_One_File enabled.
2. Update the TlistShowTag command output to display the tag scope.
3. Preserve the alternate file when opening the taglist window.
4. Restore the 'cpo' option value properly when the loading of the plugin is stopped.
5. When the plugin is recursively sourced, don't change the 'cpo' setting to the default value.
6. If a filetype contains multiple file types separated by a dot, then use the first file type.
7. When displaying tag prototypes, trim the output to fit the window width.
8. Add support for some more languages.
9. Disable the 'relativenumber' option for the taglist window.
10. On MS-Windows, use writefile() to generate the temporary batch file instead of the redir command. This fixes a problem in using the generated batch file in multi-byte encoding environments.
Fix an extra space in the check for exctags. Refresh the taglist window
folds after entering a tab. Escape special characters like backslash in
the tag name when saving a session file. Add an internal function to get
and detect file types.
The following fixes are made in this release:
1. If multiple Vim plugins register for the BufEnter autocmd, then sometimes
&&&&the buffer name supplied to the autocmd is incorrect. Use the buffer number
&&&&instead of buffer name in the BufEnter autocmd.
2. Add the filename to the tags menu only for valid file names.
1. Added support for jumping to a tag/file in a new or existing tab
&& from the taglist window (works only with Vim7 and above).
2. Added support for opening a tag in the previous window.
3. With the Tlist_File_Fold_Auto_Close variable set, when opening a
&& file from the file explorer window, the folds in the taglist window
&& are not closed correctly.&&Fixed this problem.
1. After opening a file with no tags defined in it with the
&& Tlist_Compact_Format option set, if the tags are updated, the folds
&& used for the files following the empty tags file are affected.
2. On MS-Windows, use a &taglist.cmd& temporary file to run exuberant
&& ctags. This is to handle space characters in the file names and
&& in the exuberant ctags path name.
3. In the taglist window, when a file is re-sorted or updated open the
&& fold for the file.
4. When the 'shellxquote' option is set to double quotes, escape
&& double quotes in the command executed for exuberant ctags.
5. On FreeBSD, exuberant ctags is installed as exctags, look for
&& exctags in the PATH.
6. If two taglist plugins are present (one in the system Vim directory
&& and another in the user's .vim/plugin directory), then the plugin
&& in the users's .vim directory overrides the version in the system
&& vim directory.
7. When the :TlistMessages command is issued display the debug
&& messages in a taglist.txt buffer.
8. Clear the readonly option for the taglist buffer
9. When opening a selected file, don't use the preview window, if
&& present.
When the Tlist_File_Fold_Auto_Close variable is set to 1, jumping to the taglist window closes all the folds. Modified the plugin to not close the fold for the currently active file. When the TlistLock and TlistUnlock commands are invoked, an error message is displayed. This problem is fixed.
Fixes:
Fix the problems in using the taglist plugin with Vim7 tabs. When
Tlist_File_Fold_Auto_Close is set, close the tag fold when leaving a
buffer.&&When jumping to a selected tag, if the file is opened in more
than one window, use the previous window from which the user entered
the taglist window.
New features:
Support for displaying the tag prototype as a tooltip.&&Support for
specifying additional commands after the taglist commands using the
bar separator.
Fixes:
1. When 'Tlist_Show_One_File' is set, after few files are opened,
&& unable to select tags from the taglist window.
2. When the taglist plugin is stored in a directory with space characters
&& in the name, the autoloading of taglist plugin fails.
New features:
1. Support for moving cursor to the taglist window when using the
&& &:TlistToggle& command.
2. When all the tags in a file are of the same type, in the taglist
&& menu, don't display the tag type.
3. Changed the '?' help key to 'F1' in the taglist window.
4. Set the filetype for the taglist buffer to 'taglist'
5. In Vim7, set the 'winfixwidth' option for the taglist window.
6. When jumping between files using the ]] or &Tab& and [[ or &Backspace&
&& keys, wrap around at the first and last file.
The following changes are made in this version:
1. Delay loading of the taglist plugin to reduce the Vim startup time.
2. Support for recursively adding multiples files to the taglist using the
&& ':TlistAddFilesRecursive' command.
3. New ':TlistOpen' command to open and jump to the taglist window.
4. New ':TlistToggle' command to supersede the ':Tlist' command.
5. New 'Tlist_Close_On_Select' option for closing the taglist window
&& when a file is selected.
6. New 'Tlist_Auto_Update' option to enable/disable processing of newly
&& edited files.
7. New ':TlistLock' and ':TlistUnlock' commands to lock and unlock the
&& taglist.
8. New 'Tlist_Highlight_Tag_On_BufEnter' option to enable/disable
&& highlighting of the current tag on entering a buffer.
9. When the taglist buffer is created from a Vim session file, update
&& the taglist with the files from the session file.
10. Change the background color used for highlighting file names in the
&&&&taglist window.
11. When &Space& is pressed on a file name or a tag type name in the
&&&&taglist window, display information about the number of tags.
12. Set the 'foldlevel' option to a high value in the taglist window.
13. When refreshing the taglist window, process all the opened buffers.
14. When moving between windows, disable and enable autocommands.
15. When a file is selected from the taglist window, use a non-plugin
&&&&window to edit the file.
16. If 'Tlist_Exit_OnlyWindow' is set and when exiting Vim, make sure
&&&&the '0 mark is set to the previous buffer.
17. When using the taglist plugin with the winmanager plugin and
&&&&'Tlist_Process_File_Always' is set or the taglist menu is enabled,
&&&&sometimes, it is not possible to jump to other windows from the
&&&&taglist window using the keyboard. Fixed this problem.
18. While opening files in a new window, use filenames instead of buffer
&&&&numbers.
1. Added the TlistAddFiles command to add multiple files to the taglist window without opening them.
2. Maintain the taglist window width and height across Vim window layout changes.
3. Restore the Vim window location after the taglist window is closed.
4. Use a simpler regular expression for parsing tags output.
5. When a closed fold is selected in the taglist window, open the fold and jump to the file.
6. When the Tlist_Auto_Open variable is set, open the taglist window only when a supported type of file is opened.
7. When displaying tags for a single file, center the current tag line when opening a file.
8. When jumping to a tag, add the previous location to the jump list.
9. Fixed a problem with recording timestamps in the debug messages on MS-Windows.
10. Set the ' mark when jumping to a selected tag.
Added support for optionally displaying the tags in the drop-down/popup menu. Performance enhancments, various bug fixes and debug support.
1. Introduced a new option 'Tlist_Show_One_File& to display the tags for only the current buffer in the taglist window.
2. Support for not displaying the tags for a user-deleted file in the taglist window.
3. Fix for sharing the mouse single click map with other plugins
1. If Tlist_Ctags_Cmd variable is not set, on startup, check for the
&& presence of exuberant-ctags or ctags or tags in the PATH and set
&& Tlist_Ctags_Cmd variable accordingly. If none of the executable is
&& found, then the taglist plugin will not be not loaded.
2. Added a new configuration variable Tlist_Enable_Fold_Column to
&& enable or disable fold columns in the taglist window.
3. Added support for setting the taglist application name used by the
&& winmanager plugin and the cream package.
4. Two new key mappings ([[ and ]]) are added to the taglist window to
&& move between files.
5. When a file is modified, the taglist window will be automatically
&& updated (after going to some other window or buffer and then coming
&& to the modified buffer).
6. Made the Tlist_Update_File_Tags() function as a global function.
&& This function can be used to add or update the tags for a new file.
7. Updated the Tlist_Get_Tag_Prototype_By_Line() and the
&& Tlist_Get_Tagname_By_Line() functions to get the tag name and tag
&& prototype for the specified line in a file.
Added support for closing the tags tree for inactive files, removing the tags tree for deleted buffers, processing the tags when the taglist window is not opened, disabling the automatic highlighting of the current tag, displaying name of the current tag.
Added support for saving and restoring taglist sessions. Separated the taglist documentation into a separate file in Vim help format.
Added support for displaying tags defined in multiple files.
Added information about the taglist mailing list.
1. Added TlistUpdate command to update the taglist window.
2. Made the taglist highlight groups user configurable.
3. Fixed a problem in the taglist integration with the winmanager plugin
1. Added support for previewing a tag.
2. Added the TlistClose command to close the taglist window
3. Added the Tlist_Exit_OnlyWindow option to close the taglist window if only that window is open.
Added support for highlighting the tag scope. Added support for displaying namespaces in C++ files. Updated the comments.
ip used for rating: 220.177.198.53
If you have questions or remarks about this site, visit the
Please use this site responsibly.
Questions about
Help Bram .二次元同好交流新大陆
扫码下载App
汇聚2000万达人的兴趣社区下载即送20张免费照片冲印
扫码下载App
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!&&|&&
C语言本身很简洁。 掌握一个简洁的语言, 摸透它的优缺点, 剩下的就是发挥想象力
LOFTER精选
网易考拉推荐
用微信&&“扫一扫”
将文章分享到朋友圈。
用易信&&“扫一扫”
将文章分享到朋友圈。
阅读(1630)|
用微信&&“扫一扫”
将文章分享到朋友圈。
用易信&&“扫一扫”
将文章分享到朋友圈。
历史上的今天
loftPermalink:'',
id:'fks_087074',
blogTitle:'VIM插件之taglist',
blogAbstract:'如果你能找到这个文章相信taglist做什么用的就不用解释了
下载地址:'
{list a as x}
{if x.moveFrom=='wap'}
{elseif x.moveFrom=='iphone'}
{elseif x.moveFrom=='android'}
{elseif x.moveFrom=='mobile'}
${a.selfIntro|escape}{if great260}${suplement}{/if}
{list a as x}
推荐过这篇日志的人:
{list a as x}
{if !!b&&b.length>0}
他们还推荐了:
{list b as y}
转载记录:
{list d as x}
{list a as x}
{list a as x}
{list a as x}
{list a as x}
{if x_index>4}{break}{/if}
${fn2(x.publishTime,'yyyy-MM-dd HH:mm:ss')}
{list a as x}
{if !!(blogDetail.preBlogPermalink)}
{if !!(blogDetail.nextBlogPermalink)}
{list a as x}
{if defined('newslist')&&newslist.length>0}
{list newslist as x}
{if x_index>7}{break}{/if}
{list a as x}
{var first_option =}
{list x.voteDetailList as voteToOption}
{if voteToOption==1}
{if first_option==false},{/if}&&“${b[voteToOption_index]}”&&
{if (x.role!="-1") },“我是${c[x.role]}”&&{/if}
&&&&&&&&${fn1(x.voteTime)}
{if x.userName==''}{/if}
网易公司版权所有&&
{list x.l as y}
{if defined('wl')}
{list wl as x}{/list}二次元同好交流新大陆
扫码下载App
汇聚2000万达人的兴趣社区下载即送20张免费照片冲印
扫码下载App
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!&&|&&
LOFTER精选
网易考拉推荐
用微信&&“扫一扫”
将文章分享到朋友圈。
用易信&&“扫一扫”
将文章分享到朋友圈。
阅读(2396)|
用微信&&“扫一扫”
将文章分享到朋友圈。
用易信&&“扫一扫”
将文章分享到朋友圈。
历史上的今天
loftPermalink:'',
id:'fks_095075',
blogTitle:'vim + taglist + ctags (windows)',
blogAbstract:'vim + taglist + ctags \r\n==================================\r\n在windows下安装:\r\n1. 先在www.vim.org上下载 taglist_45.zip,解压后有两个文件doc和plugin。把这个两个文件,拷到vim的安装目录的doc和plugin即可。\r\n2. 打开vim\r\n:helptags $(home)/doc\r\n:help taglist\r\n这时就可以看taglist的帮助内容了。\r\n3. 下载Exuberant Ctags\r\n',
blogTag:'',
blogUrl:'blog/static/4',
isPublished:1,
istop:false,
modifyTime:2,
publishTime:4,
permalink:'blog/static/4',
commentCount:2,
mainCommentCount:1,
recommendCount:0,
bsrk:-100,
publisherId:0,
recomBlogHome:false,
currentRecomBlog:false,
attachmentsFileIds:[],
groupInfo:{},
friendstatus:'none',
followstatus:'unFollow',
pubSucc:'',
visitorProvince:'',
visitorCity:'',
visitorNewUser:false,
postAddInfo:{},
mset:'000',
remindgoodnightblog:false,
isBlackVisitor:false,
isShowYodaoAd:false,
hostIntro:'',
hmcon:'1',
selfRecomBlogCount:'0',
lofter_single:''
{list a as x}
{if x.moveFrom=='wap'}
{elseif x.moveFrom=='iphone'}
{elseif x.moveFrom=='android'}
{elseif x.moveFrom=='mobile'}
${a.selfIntro|escape}{if great260}${suplement}{/if}
{list a as x}
推荐过这篇日志的人:
{list a as x}
{if !!b&&b.length>0}
他们还推荐了:
{list b as y}
转载记录:
{list d as x}
{list a as x}
{list a as x}
{list a as x}
{list a as x}
{if x_index>4}{break}{/if}
${fn2(x.publishTime,'yyyy-MM-dd HH:mm:ss')}
{list a as x}
{if !!(blogDetail.preBlogPermalink)}
{if !!(blogDetail.nextBlogPermalink)}
{list a as x}
{if defined('newslist')&&newslist.length>0}
{list newslist as x}
{if x_index>7}{break}{/if}
{list a as x}
{var first_option =}
{list x.voteDetailList as voteToOption}
{if voteToOption==1}
{if first_option==false},{/if}&&“${b[voteToOption_index]}”&&
{if (x.role!="-1") },“我是${c[x.role]}”&&{/if}
&&&&&&&&${fn1(x.voteTime)}
{if x.userName==''}{/if}
网易公司版权所有&&
{list x.l as y}
{if defined('wl')}
{list wl as x}{/list}}

我要回帖

更多关于 vim taglist 使用 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信