12

I have started out with macvim and now fairly comfortable with the navigation (on a single file) and now I need to write a whole project (say rails) using mvim.

In textmate, you have mate project_dir which opens the project in a side drawer, so my question is:

  1. Is there a similar feature in mvim?
  2. How can a complete project managed in traditionally in macvim?

Links to some write-ups are welcomed.

zengr
  • 38,346
  • 37
  • 130
  • 192

5 Answers5

11

Just try using Janus. Made it really easy for me to switch from TextMate.

changelog
  • 4,646
  • 4
  • 35
  • 62
10

As @changelog pointed out, the absolute best way to get MacVim to behave like Textmate is to use Janus. Janus packages up a bunch of popular plugins and provides an easy way to keep those pluggins up-to-date via a rakefile. Janus also includes NERDTree (mentioned by @zengr) along with a variety of other tools that make it really easy to manage a big project.

In order to launch mvim the way that you launch textmate with mate project_dir, an mvim script is included in the MacVim download. You just need to put it in your path (I keep mine in /usr/local/bin/mvim). Using this script you can do the exact same thing:

mvim project_dir - to open a specific directory in MacVim

mvim . or just mvim - to open your current directory in MacVim

Tim Clem
  • 1,260
  • 1
  • 11
  • 12
6

After trying out many plugins, NERDTree was the best match. Read more

enter image description here

zengr
  • 38,346
  • 37
  • 130
  • 192
2

PROJECT is really awesome. You can easily add folders to your project (single ones, or recursively), specify filters, etc.

It's really worth a try.

superiggy
  • 1,023
  • 8
  • 14
1

Try :help mksession.

Load all your 'project' files (either interactively or using the command line vim file1 file2 ....) Running :mksession xxx writes a vim script to restore the environment and load all currently loaded files.

Next time just :source xxx to reload your environment (or run vim -s xxx to execute the file on startup).

Note: For navigating source files (as opposed to data files), ctags is, in my opinion, a better option. Create a ctags database (ctags works for Ruby scripts too!) and navigate in your code tree using :tag myfunc. No need to preload any file.

nimrodm
  • 23,081
  • 7
  • 58
  • 59
  • is that the only way to manage multiple files? VIM does not have a plugin for that? – zengr Jan 11 '11 at 07:16
  • @zengr: What is it that you are missing in terms of project management? I do use the bufferexplorer plugin for switching buffers (once they are loaded). Others use the fuzzyfinder plugin. – nimrodm Jan 11 '11 at 10:46
  • @zengr: OK. Seems like there's a "project" plugin as well. Take a look at http://www.vim.org/scripts/script.php?script_id=69 – nimrodm Jan 11 '11 at 10:55