1 " Vim filetype plugin file
3 " Maintainer: Dan Sharp <dwsharp at users dot sourceforge dot net>
4 " Last Change: 20 Jan 2009
5 " URL: http://dwsharp.users.sourceforge.net/vim/ftplugin
7 if exists("b:did_ftplugin") | finish | endif
10 " Make sure the continuation lines below do not cause problems in
15 " For filename completion, prefer the .java extension over the .class
19 " Enable gf on import statements. Convert . in the package
20 " name to / and append .java to the name, then search the path.
21 setlocal includeexpr=substitute(v:fname,'\\.','/','g')
22 setlocal suffixesadd=.java
23 if exists("g:ftplugin_java_source_path")
24 let &l:path=g:ftplugin_java_source_path . ',' . &l:path
27 " Set 'formatoptions' to break comment lines but not other lines,
28 " and insert the comment leader when hitting <CR> or using "o".
29 setlocal formatoptions-=t formatoptions+=croql
31 " Set 'comments' to format dashed lists in comments. Behaves just like C.
32 setlocal comments& comments^=sO:*\ -,mO:*\ \ ,exO:*/
34 setlocal commentstring=//%s
36 " Change the :browse e filter to primarily show Java-related files.
38 let b:browsefilter="Java Files (*.java)\t*.java\n" .
39 \ "Properties Files (*.prop*)\t*.prop*\n" .
40 \ "Manifest Files (*.mf)\t*.mf\n" .
41 \ "All Files (*.*)\t*.*\n"
44 " Undo the stuff we changed.
45 let b:undo_ftplugin = "setlocal suffixes< suffixesadd<" .
46 \ " formatoptions< comments< commentstring< path< includeexpr<" .
47 \ " | unlet! b:browsefilter"
49 " Restore the saved compatibility options.