Created
June 6, 2014 14:59
-
-
Save egwynn/c75ff3ccce8b2f239362 to your computer and use it in GitHub Desktop.
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
" Open the corresponding .C/.T/.h/whatever file | |
function! EG_openMatching() | |
let path=expand("%:p:h") | |
let pattern=expand("%:t:r").".\\*" | |
let cur=expand("%:t") | |
let cmd="find ".path." -maxdepth 1 -name ".pattern." -and -not -name ".cur | |
let result=system(cmd) | |
if v:shell_error | |
echom "Error: [".result."] (".len(result).")" | |
echom "Command was: [".cmd."]" | |
elseif len(result) | |
execute ":args ".result | |
endif | |
endfun | |
nnoremap <M-C-Up> :call EG_openMatching()<CR> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment