Skip to content

Comment on Vim Splits – Move Faster and More Naturally

Comments

" Edit another file in the same directory as the current file

" uses expression to extract path from current file's path

map <leader>e :e <C-R>=expand("%:p:h") . '/'<CR><C-M>

map <leader>s :split <C-R>=expand("%:p:h") . '/'<CR><C-M>

map <leader>v :vnew <C-R>=expand("%:p:h") . '/'<CR><C-M>

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.