aboutsummaryrefslogtreecommitdiff
path: root/runtime/ftplugin/java.vim
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2014-07-11 04:05:51 +0000
committerJustin M. Keyes <justinkz@gmail.com>2014-07-29 02:12:31 +0000
commita98a6996c291b3e300d27b791eded9eed333d677 (patch)
tree51d92f6cac128f938cd0aaa9a8dd0ce7a83d63a9 /runtime/ftplugin/java.vim
parent66bc13163398786c88e20b7cdd61c66978b4d3fb (diff)
downloadrneovim-a98a6996c291b3e300d27b791eded9eed333d677.tar.gz
rneovim-a98a6996c291b3e300d27b791eded9eed333d677.tar.bz2
rneovim-a98a6996c291b3e300d27b791eded9eed333d677.zip
re-integrate runtime/ vim-patch:0 #938
Vim runtime files based on 7.4.384 / hg changeset 7090d7f160f7 Excluding: Amiga icons (*.info, icons/) doc/hangulin.txt tutor/ spell/ lang/ (only used for menu translations) macros/maze/, macros/hanoi/, macros/life/, macros/urm/ These were used to test vi compatibility. termcap "Demonstration of a termcap file (for the Amiga and Archimedes)" Helped-by: Rich Wareham <rjw57@cam.ac.uk> Helped-by: John <john.schmidt.h@gmail.com> Helped-by: Yann <yann@yann-salaun.com> Helped-by: Christophe Badoit <c.badoit@lesiteimmo.com> Helped-by: drasill <github@tof2k.com> Helped-by: Tae Sandoval Murgan <taecilla@gmail.com> Helped-by: Lowe Thiderman <lowe.thiderman@gmail.com>
Diffstat (limited to 'runtime/ftplugin/java.vim')
-rw-r--r--runtime/ftplugin/java.vim51
1 files changed, 51 insertions, 0 deletions
diff --git a/runtime/ftplugin/java.vim b/runtime/ftplugin/java.vim
new file mode 100644
index 0000000000..292cb6b166
--- /dev/null
+++ b/runtime/ftplugin/java.vim
@@ -0,0 +1,51 @@
+" Vim filetype plugin file
+" Language: Java
+" Maintainer: Dan Sharp <dwsharp at users dot sourceforge dot net>
+" Last Change: 2012 Mar 11
+" URL: http://dwsharp.users.sourceforge.net/vim/ftplugin
+
+if exists("b:did_ftplugin") | finish | endif
+let b:did_ftplugin = 1
+
+" Make sure the continuation lines below do not cause problems in
+" compatibility mode.
+let s:save_cpo = &cpo
+set cpo-=C
+
+" For filename completion, prefer the .java extension over the .class
+" extension.
+set suffixes+=.class
+
+" Enable gf on import statements. Convert . in the package
+" name to / and append .java to the name, then search the path.
+setlocal includeexpr=substitute(v:fname,'\\.','/','g')
+setlocal suffixesadd=.java
+if exists("g:ftplugin_java_source_path")
+ let &l:path=g:ftplugin_java_source_path . ',' . &l:path
+endif
+
+" Set 'formatoptions' to break comment lines but not other lines,
+" and insert the comment leader when hitting <CR> or using "o".
+setlocal formatoptions-=t formatoptions+=croql
+
+" Set 'comments' to format dashed lists in comments. Behaves just like C.
+setlocal comments& comments^=sO:*\ -,mO:*\ \ ,exO:*/
+
+setlocal commentstring=//%s
+
+" Change the :browse e filter to primarily show Java-related files.
+if has("gui_win32")
+ let b:browsefilter="Java Files (*.java)\t*.java\n" .
+ \ "Properties Files (*.prop*)\t*.prop*\n" .
+ \ "Manifest Files (*.mf)\t*.mf\n" .
+ \ "All Files (*.*)\t*.*\n"
+endif
+
+" Undo the stuff we changed.
+let b:undo_ftplugin = "setlocal suffixes< suffixesadd<" .
+ \ " formatoptions< comments< commentstring< path< includeexpr<" .
+ \ " | unlet! b:browsefilter"
+
+" Restore the saved compatibility options.
+let &cpo = s:save_cpo
+unlet s:save_cpo