5

I am switching from C#+Visual Studio to Ruby+Vim for a few months. The only thing that I am missing from C#/Visual Studio is intellisense, especially when I have a new ruby gem to familiarize.

As a programmer with a below-average memory like Joel, I miss the a happy time in Visual Studio that I can Ctrl+Space everywhere to get a hint list so that I don't have to memorize a single method , whether it's name or it's parameter list. I can even get it's usage/sample code at MSDN with only a press of F1.

So, ruby(dynamic typing language)+vim/TextMate programmers, when you are coding

Do you run google/gem API reference manual/irb/ri side by side with your vim/TextMate like me most of the time ?

or A Good memory is a must-have for ruby(or other dynamic language) programmers?

TomCaps
  • 863
  • 2
  • 7
  • 13
  • Leave the vim for hardcore people. Use IDE, it's a lot more effective. I tried coding without Intellisense, and meh, no way I'm doing that again. I have the same problem, I have better things to memorize than method and variable names. – Coder Feb 29 '12 at 14:09

4 Answers4

2

A few things that help:

  • vim has auto-completion (Ctrl-n), though it is not syntax-aware
  • a tags file (generated by exuberant-ctags or another appropriate tool) helps tons: not only does it extend the auto-completion's vocabulary, it also allows jumping through the code file using the 'tag stack' - Ctrl-] takes you to the definition of whatever the cursor is on, Ctrl-t pops you back where you came from
  • consistent naming and a DRY coding style
  • a tiling window manager and multiple screens (I prefer to have at least three: one for the code, one for the running application, one for documentation)
tdammers
  • 52,406
  • 14
  • 106
  • 154
  • Yea most of what you can do in an IDE you can also do in VIM Or emacs, and they use a LOT less system resources – Zachary K Feb 29 '12 at 14:59
  • @ZacharyK: I actually find that I am most productive with vim when I embrace its style instead of trying to bend it into an IDE. Dumb autocomplete may not give you inline documentation and all that, but it does work reliably and predictably for all languages in all contexts - even when writing English prose. Instead of Integrating the Development Environment, I like to de-integrate it and make use of the strengths of a modular OS: anything that can read text and spits out transformed text is a candidate for my toolbox. – tdammers Feb 29 '12 at 20:06
1

I ran into something similar with python. I wanted vim, but I also wanted IDE features. So I ended up rolling my own with vim plugins.

For what you want, get supertab for easy autocomplete, including dynamic method completion. Not quite as effective as an IDE, but it works. Also get snipmate for snippets.

Finally, get ConqueShell. That's very important, because it allows you to run a ruby shell inside a vim buffer! Don't know what command to use? Flip buffers, and test it. There should also be built in method help and autocompletion provided by the ruby shell.

I use conque for running ipython, which works great. I can even navigate the buffer and use vim's yank syntax for copying into a code window.

Spencer Rathbun
  • 3,576
  • 1
  • 21
  • 28
0

rubyMine is pretty amazing and shows a lot more suggestions and has much better auto-complete than Eclipse or netBeans.
Don't kick it until you try it! Free for 30 day trial anyway!

junky
  • 840
  • 5
  • 12
-1

I did not try it on my own, but this link may provide what you are looking for:

http://vootey.wordpress.com/2010/03/28/ruby-code-completion-with-vim/

(google for "vim ruby code completion" to find more links).

Doc Brown
  • 199,015
  • 33
  • 367
  • 565
  • thanks! but many of the methods in a gem are generated at runtime (like ghost methods). It's impossible to list these methods even in an IDE like RubyMine, not to mention vim. – TomCaps Feb 29 '12 at 13:13