Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I've recently started taking Scala to heart (sweet Python, I still love you, but your collections just can't match Scala's), and in doing so am now using IntelliJ IDEA almost entirely for development.

However, IDEA's Scala plugin is far from perfect, and there are many times I wish I could just go back to my one editor love -- VIM. Unfortunately, there are a few Intellisense-like features I still don't know how to retrieve. Namely,

  1. automatic imports
  2. type inconsistency recognition
  3. method definition lookup
  4. a list of valid methods or variables for instances

Can anyone recommend any tools to get these done? While Scala is the language most preferred, these concerns are equally valid for C++ and Java. I really would like to leave IDEs behind!

share|improve this question

closed as off-topic by gnat, MichaelT, Martijn Pieters, Ampt, GlenH7 Sep 15 at 2:07

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions asking us to recommend a tool, library or favorite off-site resource are off-topic for Programmers as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it." – gnat, MichaelT, Martijn Pieters, Ampt, GlenH7
If this question can be reworded to fit the rules in the help center, please edit the question.

What is your objection to using an IDE? –  Robert Harvey Nov 5 '11 at 2:49
@Robert Harvey: The feature set of vim far exceeds every IDE editor I have ever worked with. Once learned (which is very hard) it is a very productive environment. –  Loki Astari Nov 5 '11 at 11:28

3 Answers 3

These features are what makes an IDE. Vim is a text editor. Unfortunetly you cannot have the power of IDE with the speed of a text editor.

You can get SOME semi useful plugins for Vim to make it somewhat more intelligent, but you will never have what IDEA can do.

I want to add the ideally we would have Vim key-bindings within IDE but in my experience they tend to be more buggy then helpful.

share|improve this answer
Uh, you haven't used VIM much, have you?... –  Demian Brecht Nov 5 '11 at 3:02
I use vim mode in net-beans to combine the power of both. –  zhenka Nov 5 '11 at 3:13
Using omnicomplete, ctags and pyclewn (or others) for gdb/pdb integration, along with other plugins/vimrc gives you pretty much everything you need imho. –  Demian Brecht Nov 5 '11 at 3:19
Guys come on, I am not new to the Vim plugin world. The idea that it will have these features with the same intelligence behind them is a pure lie. The lint, refactoring, auto-complete, reformat etc... will always be more intelligent in IDE. These features are computationally heavy, thats why we have IDEs to begin with. Yes they load slow, but thats the sacrafice. –  zhenka Nov 5 '11 at 13:44
@zhenka - "computationally heavy" ??! –  ldigas Nov 5 '11 at 17:27

For C and C++, I heard about a project using Clang (LLVM) to bring the autocomplete feature to Vim. Read more here : http://zwiener.org/vimautocomplete.html

share|improve this answer

Use ENSIME. There are some forks that add vim stuff, such as this one.

I don't know that ENSIME will actually provide the features you are looking for, but I think it is the best shot at getting it done. It might be a matter of adding the proper macros for it. Also, ENSIME has progressed a lot on the main line, so a lot of merging might be required to make most of it.

Here's the features available in ENSIME:

  • Highlight errors and warnings in your code buffers.
  • Inspect the type of any expression.
  • Browse packages
  • Completion for variables, methods, constructors, etc.
  • Incrementally search through classpath symbols
  • Find all references to a symbol
  • Jump to symbol definitions.
  • Semantic Highlighting
  • Automated Refactorings (rename, organize imports, extract method)
  • Source Formatting
  • AST-based selection
  • Supports sbt7,10,11
  • Supports Maven,Ivy build descriptions
  • Embedded sbt shell
  • REPL
  • Debug support

On the fork I linked to, the follow features have macros written for:

  • :EnsimeRepl - read eval print loop (See documentation of vim-addon-async)
  • :EnsimeReformatSources - reformat source file and reload it into Vim (vim 7.3 can undo reloading so no care has to be taken)
  • :EnsimeDefinition - goto definition (only if its found in source file for now)
  • :EnsimeShowTypeAtCursor - show type under cursor in preview window
  • :EnsimeTypecheckAll - typecheck all (smart sorting: show the errors of the current buffer you're in first)

  • completion: (scope, type (member), constructor) completion

  • typechecking the files on bufwrite (is this annoying?)

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.