" Author: Eric Van Dewoestine " " Description: {{{ " see http://eclim.org/vim/java/index.html " " License: " " Copyright (C) 2005 - 2009 Eric Van Dewoestine " " This program is free software: you can redistribute it and/or modify " it under the terms of the GNU General Public License as published by " the Free Software Foundation, either version 3 of the License, or " (at your option) any later version. " " This program is distributed in the hope that it will be useful, " but WITHOUT ANY WARRANTY; without even the implied warranty of " MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the " GNU General Public License for more details. " " You should have received a copy of the GNU General Public License " along with this program. If not, see . " " }}} " Global Variables {{{ if !exists("g:EclimJavaSrcValidate") let g:EclimJavaSrcValidate = 1 endif if !exists("g:EclimJavaSetCommonOptions") let g:EclimJavaSetCommonOptions = 1 endif if !exists("g:EclimJavaCompilerAutoDetect") let g:EclimJavaCompilerAutoDetect = 1 endif if !exists("g:EclimJavaSearchMapping") let g:EclimJavaSearchMapping = 1 endif if !exists("g:EclimJavaCheckstyleOnSave") let g:EclimJavaCheckstyleOnSave = 0 endif " }}} " Options {{{ setlocal completefunc=eclim#java#complete#CodeComplete if g:EclimJavaSetCommonOptions " allow cpp keywords in java files (delete, friend, union, template, etc). let java_allow_cpp_keywords=1 " tell vim how to search for included files. setlocal include=^\s*import setlocal includeexpr=substitute(v:fname,'\\.','/','g') setlocal suffixesadd=.java endif " set make program and error format accordingly. if g:EclimJavaCompilerAutoDetect " use ant settings if eclim#util#Findfile('build.xml', '.;') != '' compiler eclim_ant " use mvn settings elseif eclim#util#Findfile('pom.xml', '.;') != '' compiler eclim_mvn if !g:EclimMakeLCD && !exists('g:EclimMakeLCDWarning') call eclim#util#EchoWarning("WARNING: g:EclimMakeLCD disabled.\n" . \ "Unlike maven and ant, mvn does not provide a mechanism to " . \ "search for the target build file.\n" . \ "Disabling g:EclimMakeLCD may cause issues when executing :make or :Mvn") let g:EclimMakeLCDWarning = 1 endif " use maven settings elseif eclim#util#Findfile('project.xml', '.;') != '' compiler eclim_maven " use standard jikes if available elseif executable('jikes') compiler jikes let g:EclimMakeLCD = 0 " default to standard javac settings else compiler javac let g:EclimMakeLCD = 0 endif endif " }}} " Abbreviations {{{ if !exists("g:EclimLoggingDisabled") || !g:EclimLoggingDisabled inoreabbrev log log=eclim#java#logging#LoggingInit("log") inoreabbrev logger logger=eclim#java#logging#LoggingInit("logger") endif " }}} " Autocmds {{{ if &ft == 'java' augroup eclim_java autocmd! BufWritePost autocmd BufWritePost call eclim#java#util#UpdateSrcFile(0) augroup END endif " }}} " Command Declarations {{{ if !exists(":Validate") command -nargs=0 -buffer Validate :call eclim#java#util#UpdateSrcFile(1) endif if !exists(":JavaCorrect") command -buffer JavaCorrect :call eclim#java#correct#Correct() endif if !exists(":JavaFormat") command -buffer -range JavaFormat \ :call eclim#java#format#Format(, , "dummy") endif if !exists(":JavaImport") command -buffer JavaImport :call eclim#java#import#Import() endif if !exists(":JavaImportSort") command -buffer JavaImportSort :call eclim#java#import#SortImports() endif if !exists(":JavaImportClean") command -buffer JavaImportClean :call eclim#java#import#CleanImports() endif if !exists(":JavaImportMissing") command -buffer JavaImportMissing :call eclim#java#import#ImportMissing() endif if !exists(":JavaDocComment") command -buffer JavaDocComment :call eclim#java#doc#Comment() endif if !exists(":Javadoc") command -buffer -bang -nargs=* \ -complete=customlist,eclim#java#doc#CommandCompleteJavadoc \ Javadoc :call eclim#java#doc#Javadoc('', ) endif if !exists(":Javac") command -buffer -bang Javac :call eclim#java#util#Javac('') endif if exists(":Java") != 2 command -buffer -nargs=* Java :call eclim#java#util#Java('', ) endif if exists(":JavaListInstalls") != 2 command -buffer -nargs=* JavaListInstalls :call eclim#java#util#ListInstalls() endif if !exists(":JavaRegex") command -buffer JavaRegex :call eclim#regex#OpenTestWindow('java') endif if !exists(":JavaConstructor") command -buffer -range=0 JavaConstructor \ :call eclim#java#constructor#Constructor(, ) endif if !exists(":JavaGet") command -buffer -range JavaGet \ :call eclim#java#bean#GetterSetter(, , "getter") endif if !exists(":JavaSet") command -buffer -range JavaSet \ :call eclim#java#bean#GetterSetter(, , "setter") endif if !exists(":JavaGetSet") command -buffer -range JavaGetSet \ :call eclim#java#bean#GetterSetter(, , "getter_setter") endif if !exists(":JavaImpl") command -buffer JavaImpl :call eclim#java#impl#Impl() endif if !exists(":JavaDelegate") command -buffer JavaDelegate :call eclim#java#delegate#Delegate() endif if !exists(":JavaSearch") command -buffer -nargs=* \ -complete=customlist,eclim#java#search#CommandCompleteJavaSearch \ JavaSearch :call eclim#java#search#SearchAndDisplay('java_search', '') endif if !exists(":JavaSearchContext") command -buffer JavaSearchContext \ :call eclim#java#search#SearchAndDisplay('java_search', '') endif if !exists(":JavaDocSearch") command -buffer -nargs=* \ -complete=customlist,eclim#java#search#CommandCompleteJavaSearch \ JavaDocSearch :call eclim#java#search#SearchAndDisplay('java_docsearch', '') endif if !exists(":JavaHierarchy") command -buffer -range JavaHierarchy :call eclim#java#hierarchy#Hierarchy() endif if !exists(":JavaRename") command -nargs=1 -buffer JavaRename :call eclim#java#refactor#Rename('') endif if !exists(":JavaRefactorUndo") command -buffer JavaRefactorUndo :call eclim#java#refactor#UndoRedo('undo', 0) command -buffer JavaRefactorRedo :call eclim#java#refactor#UndoRedo('redo', 0) command -buffer JavaRefactorUndoPeek \ :call eclim#java#refactor#UndoRedo('undo', 1) command -buffer JavaRefactorRedoPeek \ :call eclim#java#refactor#UndoRedo('redo', 1) endif if !exists(":JavaLoggingInit") command -buffer JavaLoggingInit :call eclim#java#logging#LoggingInit() endif if !exists(":JUnitExecute") command -buffer -nargs=? -complete=customlist,eclim#java#junit#CommandCompleteTest \ JUnitExecute :call eclim#java#junit#JUnitExecute('') endif if !exists(":JUnitResult") command -buffer -nargs=? -complete=customlist,eclim#java#junit#CommandCompleteResult \ JUnitResult :call eclim#java#junit#JUnitResult('') endif if !exists(":JUnitImpl") command -buffer JUnitImpl :call eclim#java#junit#JUnitImpl() endif if !exists(":Checkstyle") command -nargs=0 -buffer Checkstyle :call eclim#java#checkstyle#Checkstyle() endif " }}} " vim:ft=vim:fdm=marker