Wikia

Vim Tips Wiki

Changes: Open Windows Explorer showing directory of current buffer

Edit

Back to page

(Remove html character entities)
(minor tweaks)
 
Line 3: Line 3:
 
{{TipImported
 
{{TipImported
 
|id=1336
 
|id=1336
|previous=1335
+
|previous=1334
 
|next=1338
 
|next=1338
|created=September 21, 2006
+
|created=2006
 
|complexity=basic
 
|complexity=basic
 
|author=Erez Volk
 
|author=Erez Volk
|version=5.7
+
|version=6.0
 
|rating=26/25
 
|rating=26/25
 
|category1=
 
|category1=
Line 14: Line 14:
 
}}
 
}}
 
When working in Windows, I have the following in my vimrc, which I find very useful to start Windows Explorer:
 
When working in Windows, I have the following in my vimrc, which I find very useful to start Windows Explorer:
 
 
<pre>
 
<pre>
 
nmap <F11> :!start explorer /e,,%:p:h<CR>
 
nmap <F11> :!start explorer /e,,%:p:h<CR>
Line 25: Line 24:
 
----
 
----
 
To get it to select the current file, use the following:
 
To get it to select the current file, use the following:
 
 
<pre>
 
<pre>
 
nmap <F11> :!start explorer /select,%:p
 
nmap <F11> :!start explorer /select,%:p
Line 33: Line 31:
 
----
 
----
 
To combine options to windows commands just put a comma between them. So to combine the examples given above do:
 
To combine options to windows commands just put a comma between them. So to combine the examples given above do:
 
 
<pre>
 
<pre>
 
:!start explorer /e,,%:p:h,/select,%:p
 
:!start explorer /e,,%:p:h,/select,%:p
Line 40: Line 37:
 
----
 
----
 
For OS X users:
 
For OS X users:
 
 
<pre>
 
<pre>
 
nmap <Leader>f :!open %:p:h<CR>
 
nmap <Leader>f :!open %:p:h<CR>
Line 47: Line 43:
 
----
 
----
 
Just a little bit more useful:
 
Just a little bit more useful:
 
 
<pre>
 
<pre>
 
nmap <F11> :silent !start explorer /e,,%:p:h,/select,%:p<CR>
 
nmap <F11> :silent !start explorer /e,,%:p:h,/select,%:p<CR>

Latest revision as of 10:41, October 12, 2011

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>

CommentsEdit

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