3

Most of my career I've been in windows environments using IntelliJ/Eclipse/Visual Studio. I've recently started working on a Mac for the fist time. So far, loving it. I'm also taking this opportunity to learn vim and make MacVim my main editor. Mostly I'm working with front end stuff (javascript/css) but I go back and forth to a java backend sometimes.

I'm really missing a few things from the big IDE's and wondering if they are possible in Macvim:

1) Code Completion - shortcut to autocomplete a method I'm typing

2) Go to Declaration - I know gd will go to a declaration locally in a file, but what about over multiple files?

3) Navigate to file - I know you can use :tabnew ../somedir/somefile or just use a terminal console, but is there a quicker way to do this? (IntelliJ was Ctrl-Shift-N to navigate to file in a project)

I know doing this stuff might involve some form of indexing all your files and having an actual project. It might not really be possible. But, if anyone has suggestions I'd appreciate it. Thanks

mawaldne
  • 3,619
  • 5
  • 29
  • 36
  • 1
    For navigating to a file, I recommend checking out the NERDTree plugin. Once installed just invoke it with ":NERDTree path/to/project" and it will create a nice treeview of your project. – Matt Greer Apr 08 '11 at 17:31
  • Thanks Matt. Using it now, I like it so far. – mawaldne Apr 08 '11 at 20:22

2 Answers2

6
  1. Look into Vim's Omnicomplete. This works by consulting tag files generated by ctags. Also, Ctl-n will complete for words used all currently open buffers. Get into the habit of hitting Ctl-n while you type in insert mode. See help: omnifunc to setup omnicomplete.
  2. Also done with ctags. Ctl-] jumps to a tag definition, and Ctl-t returns to previous position in the tag stack. For info do :help tags Also lots more useful info in this question
  3. Try out the NERDtree plugin.
Community
  • 1
  • 1
Michael Berkowski
  • 253,311
  • 39
  • 421
  • 371
  • I found another good macvim plugin called 'Control T'. It's the replacement for Navigate To file I was looking for! (https://github.com/wincent/Command-T) – mawaldne Apr 13 '11 at 17:19
1

Have a look at eclim, a eclipse plugin for code completion and more (e.g. workspace and project handling).

moritz
  • 4,738
  • 1
  • 22
  • 33