annotate runtime/ftplugin/java.vim @ 31654:dc77b797c102

Added tag v9.0.1159 for changeset ec76f9d2319e18c1c8f587f7669059b07a846447
author Bram Moolenaar <Bram@vim.org>
date Sun, 08 Jan 2023 21:00:06 +0100
parents c968191a8557
children 8ae680be2a51
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
28010
c968191a8557 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 3410
diff changeset
3 "
c968191a8557 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 3410
diff changeset
4 " This runtime file is looking for a new maintainer.
c968191a8557 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 3410
diff changeset
5 "
c968191a8557 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 3410
diff changeset
6 " Former maintainer: Dan Sharp
3410
94601b379f38 Updated runtime files. Add Dutch translations.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
7 " Last Change: 2012 Mar 11
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 if exists("b:did_ftplugin") | finish | endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 let b:did_ftplugin = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 " Make sure the continuation lines below do not cause problems in
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13 " compatibility mode.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 let s:save_cpo = &cpo
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 set cpo-=C
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 " For filename completion, prefer the .java extension over the .class
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 " extension.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 set suffixes+=.class
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 " Enable gf on import statements. Convert . in the package
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 " name to / and append .java to the name, then search the path.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23 setlocal includeexpr=substitute(v:fname,'\\.','/','g')
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 setlocal suffixesadd=.java
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 if exists("g:ftplugin_java_source_path")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 let &l:path=g:ftplugin_java_source_path . ',' . &l:path
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 " Set 'formatoptions' to break comment lines but not other lines,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 " and insert the comment leader when hitting <CR> or using "o".
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 setlocal formatoptions-=t formatoptions+=croql
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 " Set 'comments' to format dashed lists in comments. Behaves just like C.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 setlocal comments& comments^=sO:*\ -,mO:*\ \ ,exO:*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 setlocal commentstring=//%s
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 " Change the :browse e filter to primarily show Java-related files.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 if has("gui_win32")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40 let b:browsefilter="Java Files (*.java)\t*.java\n" .
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 \ "Properties Files (*.prop*)\t*.prop*\n" .
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 \ "Manifest Files (*.mf)\t*.mf\n" .
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43 \ "All Files (*.*)\t*.*\n"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46 " Undo the stuff we changed.
232
41e7594cac8b updated for version 7.0065
vimboss
parents: 7
diff changeset
47 let b:undo_ftplugin = "setlocal suffixes< suffixesadd<" .
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48 \ " formatoptions< comments< commentstring< path< includeexpr<" .
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49 \ " | unlet! b:browsefilter"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51 " Restore the saved compatibility options.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52 let &cpo = s:save_cpo
3410
94601b379f38 Updated runtime files. Add Dutch translations.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
53 unlet s:save_cpo