VIM - cd into the directory of current open file
If you use a fuzzy finder plugin with VIM (like ctrlp or command-t), you might want sometime to actually be in the directory of the file your editing. To do this, add this mapping to your config file (.vimrc
):
nnoremap <silent> <leader>d :cd %:p:h<cr>
Written by Aliou Diallo
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Vim
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#