Tip #311: Open the folder containing the currently open file
tip karma |
Rating 13/7, Viewed by 761
|
created: |
|
August 13, 2002 16:40 |
|
complexity: |
|
basic |
author: |
|
Thomas R. Kimpton |
|
as of Vim: |
|
5.7 |
Occasionally, on windows, I have files open in gvim, that the folder for that file is not open. This key map opens the folder that contains the currently open file. The expand() is so that we don't try to open the folder of an anonymous buffer, we would get an explorer error dialog in that case.
if has("gui_running")
if has("win32")
" Open the folder containing the currently open file. Double <CR> at end
" is so you don't have to hit return after command. Double quotes are
" not necessary in the 'explorer.exe %:p:h' section.
:map <silent> <C-F5> :if expand("%:p:h") != ""<CR>:!start explorer.exe %:p:h<CR>:endif<CR><CR>
endif
endif
Tom.
<<showing ascii value of the current character in decimal, hex, and octal |
Copy, Cut, and Paste >>
Additional Notes
|