Created
February 22, 2012 14:26
-
-
Save bouzuya/1885339 to your computer and use it in GitHub Desktop.
autoload/*.vim <-> plugin/*.vim
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function! s:open_pair_file() | |
let path = expand('%:p') | |
let pairs = [ | |
\ ['/autoload/\([^/]\+\).vim$', '/plugin/\1.vim'], | |
\ ['/plugin/\([^/]\+\).vim$', '/autoload/\1.vim'] | |
\ ] | |
for [pat, sub] in pairs | |
if match(path, pat) != -1 | |
execute 'hide' 'edit' substitute(path, pat, sub, '') | |
break | |
endif | |
endfor | |
endfunction | |
nnoremap <Space>p :<C-u>call <SID>open_pair_file()<CR> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment