Tuesday, April 7, 2009

Vim - Open Current File in Explorer or Command Prompt

Put the following two lines in your vimrc files under window to get F11 and F12 to work as "command prompt here" and "explorer here" !


map :silent !start cmd.exe /k pushd %:p:h
map :silent !start explorer.exe %:p:h


source for tip1

"http://vim.wikia.com/wiki/Open_the_folder_containing_the_currently_open_file"

source for tip2

A variant of tip 1 using windows trick of adding a registry for folders to open a command prompt 

Note : % represents the file open in current buffer

No comments: