Cloud
Cloud

Reputation: 19333

VIM as an IDE - Suggestions

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.

Upvotes: 14

Views: 5289

Answers (4)

jdg
jdg

Reputation: 2298

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 ,

Upvotes: 1

prongs
prongs

Reputation: 9606

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.. :)

Upvotes: 2

Lumi
Lumi

Reputation: 15264

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.

Upvotes: 8

Vincenzo Pii
Vincenzo Pii

Reputation: 19805

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.

Upvotes: 3

Related Questions