Autochange Directory in VimSubmitted by jessie on Tue, 08/24/2010 - 9:13am |
I love Vim. With a fiery passion! One thing which has been bothering me lately, however, is having to change directories manually in Vim. I have found a solution which takes care of this. It automatically switches the directory to the current buffer's location. Add this to your ~/.vimrc:
" auto-change directory to current buffer
autocmd BufEnter * :cd %:p:h
- jessie's blog
- 1676 reads