annotate runtime/ftplugin/java.vim @ 869:31bff9be0a77 v7.0g04

updated for version 7.0g04
author vimboss
date Fri, 05 May 2006 21:18:03 +0000
parents 41e7594cac8b
children 7bc41231fbc7
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1 " Vim filetype plugin file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2 " Language: Java
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3 " Maintainer: Dan Sharp <dwsharp at hotmail dot com>
232
41e7594cac8b updated for version 7.0065
vimboss
parents: 7
diff changeset
4 " Last Change: 2005 Mar 28
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5 " URL: http://mywebpage.netscape.com/sharppeople/vim/ftplugin
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7 if exists("b:did_ftplugin") | finish | endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 let b:did_ftplugin = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 " Make sure the continuation lines below do not cause problems in
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 " compatibility mode.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 let s:save_cpo = &cpo
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13 set cpo-=C
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 " For filename completion, prefer the .java extension over the .class
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16 " extension.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 set suffixes+=.class
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 " Enable gf on import statements. Convert . in the package
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20 " name to / and append .java to the name, then search the path.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 setlocal includeexpr=substitute(v:fname,'\\.','/','g')
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 setlocal suffixesadd=.java
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23 if exists("g:ftplugin_java_source_path")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 let &l:path=g:ftplugin_java_source_path . ',' . &l:path
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 " Set 'formatoptions' to break comment lines but not other lines,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 " and insert the comment leader when hitting <CR> or using "o".
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 setlocal formatoptions-=t formatoptions+=croql
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 " Set 'comments' to format dashed lists in comments. Behaves just like C.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 setlocal comments& comments^=sO:*\ -,mO:*\ \ ,exO:*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 setlocal commentstring=//%s
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 " Change the :browse e filter to primarily show Java-related files.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 if has("gui_win32")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 let b:browsefilter="Java Files (*.java)\t*.java\n" .
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 \ "Properties Files (*.prop*)\t*.prop*\n" .
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40 \ "Manifest Files (*.mf)\t*.mf\n" .
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 \ "All Files (*.*)\t*.*\n"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 " Undo the stuff we changed.
232
41e7594cac8b updated for version 7.0065
vimboss
parents: 7
diff changeset
45 let b:undo_ftplugin = "setlocal suffixes< suffixesadd<" .
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46 \ " formatoptions< comments< commentstring< path< includeexpr<" .
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47 \ " | unlet! b:browsefilter"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49 " Restore the saved compatibility options.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50 let &cpo = s:save_cpo