Skip to content

Instantly share code, notes, and snippets.

@latentflip
Created February 20, 2014 11:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save latentflip/9111695 to your computer and use it in GitHub Desktop.
Save latentflip/9111695 to your computer and use it in GitHub Desktop.
let mapleader = ","
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" OPEN FILES IN DIRECTORY OF CURRENT FILE
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
cnoremap %% <C-R>=expand('%:h').'/'<cr>
map <leader>e :edit %%
map <leader>s :sp<cr>:edit %%
map <leader>v :vsp<cr>:edit %%
@latentflip
Copy link
Author

(here I've mapped leader to comma)

  • Open a file relative to the current file hit e
  • Open a file relative to the current file in a horizontal split s
  • Open a file relative to the current file in a vertical split v

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment