Vim Edit File From Current Directory
Anywhere that vim asks you to select a file you can first press CTRL-p
(aka ^p). This will automatically add the current files directory to start off with.
For instance, open vim, run :e, then strike the ^p combo.
If you wanted to map this functionality to access it more easily you can add the following to your vimrc:
map :E :e <C-R>=expand("%:p:h") . "/" <CR>
Full Disclosure I learned the ^p stuff from @Effektz (on twitter)
Written by Michael
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Vim
Authors
Related Tags
#vim
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#