14

I am looking for recommendations on using VIM as an IDE. I generally code in a number of programming languages, including C, C++, assembler, MATLAB, Maple, BASH scripts, to name a few.

In general, I like to use a single IDE for the bulk of my projects for the sake of consistency, and I have found that I perform about 90% of all my coding in VIM, and occasionally use Eclipse instead for certain projects in C/C++ (ie: projects people have already put together as an Eclipse project, or PIC24/32 projects from www.microchip.com).

I am already very familiar with the basic functionality of VIM (windows vs buffers, text manipulation, scripting), and would like to use it as my primary IDE. I have already taken a few tips from here: http://vim.wikia.com/wiki/Use_Vim_like_an_IDE#Writing_Code

I already use the nerdTree plugin for directory browsing in a project, etc, but I need to do something about code completion and symbol resolution, as those are my two greatest concerns.

  1. Symbol resolution
    • I have some limited experience in the use of C-tags, and wanted a suggestion on what I should use if I am working with a VERY large code-base that changes frequently. The projects I work on typically are pulling in header files from at least a dozen other projects, and I would like to be able to jump to the file where a function, constant, or macro is defined quickly (ie: like the CTRL-G feature in Eclipse, "jump to definition"), as well as rapidly get a list of all calls/references to a function/macro/constant/etc (ie: like the CTRL-SHIFT-G feature in Eclipse, "Show all references in project or current working directory").
  2. Tab completion
    • One of the features I really like in Visual Studio and Eclipse, for example, is when I type in a variable name (ie: pointer to struct) and it resolves the names and types of all structure members and gives me a tab completion list to choose the appropriate member. They also point out when I've incorrectly used "." vs "->" for member access. I've tried superTab in VIM, but I just couldn't get it working. I also want the tab-completion feature to use the same C-tags as generated by the symbol resolution plugin
  3. Handling build output
    • The final concern of mine is having an auto-generated list of build warnings and build errors. When I, for example, just run "make all" at the command-line prompt, it is a pain to have to read through code listings to manually find all build warnings.

I realize this is a lot to ask, and that I could always just fall-back to Visual Studio or Eclipse, but I really want just a simple cross-platform console-capable modal editor for all my development needs, and none of the major IDE's out there fill this need.

Thank you all in advance.

Cloud
  • 18,753
  • 15
  • 79
  • 153
  • 1
    possible duplicate of [How can I make VIM a full fledged IDE](http://stackoverflow.com/questions/7206469/how-can-i-make-vim-a-full-fledged-ide) – Greg Hewgill Mar 31 '12 at 20:07

4 Answers4

8

I think (but haven't checked) that Eclim satisfies #1 and #2 while I'm sure that Syntastic satisfies #3. More things of interest:

And are you aware of omnicompletion via Ctrl-p and Ctrl-n (prev and next) in insert mode? That's not code completion, but frequently does the job.

Lumi
  • 14,775
  • 8
  • 59
  • 92
  • +1: I use eclim, this is **really** life-changing for me. It definitely satisfies #1 and #2. It supports refactoring too. (I use eclim for Java only right now, for C/C++ I use ctags + Indexer http://goo.gl/gkFPp , but eclim can work with other languages too. I just didn't test it yet.) – Dmitry Frank Apr 02 '12 at 09:40
3

For the auto-completion part (point 2), I am proficiently using clang_complete.

For a quick setup and reference, try this page: http://zwiener.org/vimautocomplete.html

EDIT: this is for C, C++ and Objective-C only.

Vincenzo Pii
  • 18,961
  • 8
  • 39
  • 49
2

I use the following configuration in vim:

zipped file

It has autocomplete based on tag list, ctags, nerd commenter and some more plugins.

Hope it helps.. :)

Bobby
  • 11,419
  • 5
  • 44
  • 69
prongs
  • 9,422
  • 21
  • 67
  • 105
  • 1
    I'm sorry, it works for me. I tried it in on different browser too. Anyways, try this: [j.mp link](http://j.mp/rajat_vim) or [this](https://www.evernote.com/shard/s134/sh/ffc9b220-54bc-42a0-8652-a18b249a28aa/c706d140f6f00868ed1b5621028a308e) – prongs Apr 08 '12 at 19:04
  • 1
    Your last link works, thanks. Also, please stop using URL-Shorteners [we're having a hard time](http://meta.stackexchange.com/questions/99136/let-me-flag-that-for-you-url-shortener-cleanup) [getting rid of them](http://meta.stackexchange.com/questions/64450/ban-url-shorting-services). – Bobby Apr 10 '12 at 06:31
  • @Bobby: I didn't know shortened urls are bad. Now I'm educated. I can't change the j.mp link in my previous comment but it is the same as [the other link](https://www.evernote.com/shard/s134/sh/ffc9b220-54bc-42a0-8652-a18b249a28aa/c706d140f6f00868ed1b5621028a308e) – prongs Apr 10 '12 at 10:37
1

I have been using Vim as an IDE for about a year now. All of my customization is online at github.

That said, I don't think a Vim beginner should start using vim like this; rather I think the Vim beginner should learn vim incrementally. The only changes that I think are so essential I would make them from the very beginning are:

  1. Remap ESC to jk
  2. Switch : and ;
  3. Set leader key to ,
jdg
  • 2,230
  • 2
  • 20
  • 18
  • Fair enough, but I did note I already use it for 90% of my projects, so I wouldn't qualify as a rank beginner. – Cloud Dec 23 '13 at 17:18