Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
add comment

1 Answer

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 at 19:23
@Ben, that kind of thing could happen, yes. Links fixed. –  romainl Mar 24 at 20:33
add comment

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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