打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
Use Vim like an IDE

Use Vim like an IDE

created 2006 · complexity intermediate · author Matt Zyzik · version 6.0


I use Vim for all text editing, even software development. At one point I stopped using IDEs. One major reason is that Vim can do all the major things I need from IDEs (tabs, file trees, greping, syntax highlighting, indentation, completion, "quickfix"ing, etc).


Vim Plugins
Edit

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
Edit

  • 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

Buffer/File Browsing
Edit

  • 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.

Code Browsing
Edit

  • 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
Edit

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

Vim Functionality
Edit

  • matchit improves % matching
  • bufkill allows you to delete a buffer without actually closing the window.
  • gundo visualizes your undo tree.
  • surround makes it easier to delete/change/add parentheses/quotes/XML-tags/much more.

IDE integration
Edit

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
Edit

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

See also Category:VersionControl

Debugging
Edit

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
Edit

Comments
Edit

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 OmniCppDefine 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 .
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
A Detailed tmux Walkthrough to Boost Your Productivity
Code Completion with VIM 7 ? Les Harris
用Vim打造Perl的IDE
vim入门,进阶与折腾
Vim and Ctags
Build an IDE with tmux and vim
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服