Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I use the NerdTree plugin for MacVim religiously, and find myself often wanting to open a folder in the Finder to work with the files. An example would be wanting to preview and copy some images.

Is there a quick way to do this that doesn't involve changing the current directory? My perfect scenario would be:

  • Move cursor to desired folder
  • Press "some key"
  • Folder opens up in the finder.
share|improve this question

The shell command to open a folder is

$ open /path/to/folder

In a Vim function, this command could be invoked like this:

let g:mypath = /path/to/folder
execute "silent !open " . g:mypath

NERDTree's documentation has a simple and easy to follow example that you can expand using the global objects listed above.

share|improve this answer
    
Pretty sure your links to the documentation are out of date. – Ben Mar 24 '14 at 19:23
    
@Ben, that kind of thing could happen, yes. Links fixed. – romainl Mar 24 '14 at 20:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .