Wikia

Vim Tips Wiki

Open Windows Explorer showing directory of current buffer

Talk0
1,612pages on
this wiki
Revision as of 00:16, September 30, 2008 by JohnBot (Talk | contribs)

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 September 21, 2006 · complexity basic · author Erez Volk · version 5.7


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>

Comments

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>

Around Wikia's network

Random Wiki