Created
April 23, 2009 17:36
-
-
Save thinca/100632 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
autocmd BufReadPost,BufNewFile *.class call s:detect_javaclass() | |
function! s:detect_javaclass() | |
let file = expand('<afile>') | |
if !filereadable(file) | |
return | |
endif | |
let line = readfile(file, 'b', 1)[0] | |
if 4 <= strlen(line) && line[:3] == "\xCA\xFE\xBA\xBE" | |
setlocal filetype=javaclass | |
endif | |
endfunction |
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
if executable('jad') | |
silent %!jad -t -clear -ff -nonlb -8 -p "%" | |
runtime! syntax/java.vim | |
setlocal readonly | |
endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment