VIM配置大全

全文转自“Use Vim like an IDE

最近配置vim,受够了一个插件一个插件地查,查出的结果还不能用的悲剧。发现在http://vim.wikia.com/wiki/Use_Vim_like_an_IDE 中有很全的介绍,基本上覆盖了所有的vim插件,拷贝过来给大家看看。

感觉涵盖了大部分所需的配置,为博取眼球,故命名为“VIM配置大全”

Vim Plugins

Still Vim needs plugins to do some IDE-like things that aren't built in. Here are some Vim scripts that make Vim more like an IDE.

Note: You can use pathogen to isolate your plugins and make it easier to experiment with new plugins.

Project/Filetree Browsing

  • NERDTree is a tree explorer plugin for navigating the filesystem.

  • vtreeexplorer is a tree based file explorer.

  • project gives you a "project" view of files, rather than a straight file system view

  • ide Tracks files status (open/edited/closed/read only) within a project with icons; automatically builds and updates syntax highlight rules based on the project files (C/C++/Java); avoids buffer duplication; see demo.

  • :help netrw for information about the explorer distributed with Vim. It does not display files in a tree by default, but can by using the g:netrw_liststyleoption. It also offers useful file-sorting options (by date, size, name).

Buffer/File Browsing

  • bufexplorer lets you navigate through open buffers

  • minibufexpl Elegant buffer explorer; takes very little screen space.

  • lookupfile Lookup files using Vim7 ins-completion

  • Command-T plugin, inspired by the "Go to File" window bound to Command-T in TextMate

  • MRU access recently opened files.

  • ctrlp Fuzzy file, buffer, mru, tag, ... finder with regexp support. Writen in vim language. Access all the functions with ctrl-p

  • FuzzyFinder same as previous.

Code Browsing

  • taglist gives you an outline of the source you're viewing

  • Tagbar similar to taglist but can order tags by scope. Recommend for programming languages with classes, e.g. C++, Java, Python.

  • Indexer generates tags for all files in project automatically and keeps tags up-to-date. Using ctags. Works well with project plugin or independently.

  • CCTree is a Call-Tree Explorer, Cscope based source-code browser, and code flow analyzer.

  • exUtility global search, symbol search, tag track...(Like IDE/Source Insight).

  • ShowMarks visually shows the location of marks.

See also Browsing programs with tags and Cscope.

Writing Code

See also Omni completion and Make Vim completion popup menu work just like in an IDE.

Vim Functionality

IDE integration

You may want to use your IDE for some tasks like debugging, so some integration between Vim and the IDE can be helpful.

Source Control Integration

There are many Vim plugins for different source control management systems. Here are a few.

See also Category:VersionControl

Debugging

There are several projects to add debugging functionality to vim

  • Clewn implements full gdb support in the vim editor: breakpoints, watch variables, gdb command completion, assembly windows, etc.

  • vim-debug, which creates an integrated debugging environment in VIM.

  • gdbvim plugin: Watch in vim what you debug in gdb. And more.

Refactoring

Comments

When using Visual Studio, see ViEmu.


Code navigation in vi offers much more than a standard IDE, because of the ability to execute the desired combination of commands. Generate an index much more rapidly than an IDE with a heavy GUI interface:

For example, one can take advantage of the tag stack:

For C++, follow the instructions: on using OmniCpp Define a custom .ctags file

--c++-kinds=+p
--fields=+iaS
--extra=+q
--language-force=C++

From a console (the exclude options may vary) generate the tags file as follows:

ctags --exclude=.svn --exclude=target -R .


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值