Vim Tips Wiki

Open Windows Explorer showing directory of current buffer

1,623pages on
this wiki
Add New Page
Add New Page Talk0

Duplicate tip

This tip is very similar to the following:

These tips need to be merged – see the merge guidelines.

Tip 1336 Printable Monobook Previous Next

created 2006 · complexity basic · author Erez Volk · version 6.0

When working in Windows, I have the following in my vimrc, which I find very useful to start Windows Explorer:

nmap <F11> :!start explorer /e,,%:p:h<CR>
imap <F11> <Esc><F11>


Pressing Win-E is an easier way to start Explorer, if you have a keyboard with the Windows key.

To get it to select the current file, use the following:

nmap <F11> :!start explorer /select,%:p
imap <F11> <Esc><F11>

To combine options to windows commands just put a comma between them. So to combine the examples given above do:

:!start explorer /e,,%:p:h,/select,%:p

For OS X users:

nmap <Leader>f :!open %:p:h<CR>

Just a little bit more useful:

nmap <F11> :silent !start explorer /e,,%:p:h,/select,%:p<CR>

Also on Fandom

Random Wiki