w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
How do I open the windows command prompt to the current directory of the active file in VIM?

I figured out a good way to do it.

:!start cmd /k cd %:p:h

This will open the command prompt to the directory of the current file.

I ended up adding these command to my vimrc file so I can easily open command prompt or windows explorer at the current file's directory.

"Open command prompt by running :Cp
command Cp :!start cmd /k cd %:p:h<CR>

"Open windows explorer by running :We
command We :!start Explorer /select,%:p<CR>

© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.