Created
December 10, 2016 21:42
-
-
Save brooth/a89faaa35b52277dd1d1981d5f991d47 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
" | |
" retuns main class name of current file. uses ctags | |
" | |
function! GetCanonicalClassName() | |
return system("ctags -f - -u --java-kinds=pc " . expand('%:p') . " | grep -m 2 -o '^[^ ]*' | tr '\\n' '.' | sed 's/.$/\\n/'") | |
endfunction | |
function! GetSimpleClassName() | |
return system("ctags -f - -u --java-kinds=c " . expand('%:p') . " | grep -m 1 -o '^[^ ]*'") | |
endfunction |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment