Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

java changes

  • Loading branch information...
commit 04f1d570b93603dfa4c9bd92644507f50f7afb9f 1 parent b56dae1
@fishman authored
Showing with 46 additions and 4 deletions.
  1. +3 −4 .vimrc
  2. +43 −0 ftplugin/java.vim
View
7 .vimrc
@@ -619,13 +619,13 @@ set directory=$VIMDATA/temp
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Text Options: {{{1
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
-" set expandtab
+set expandtab
" set smarttab " use tabs at start of a line, spaces elsewhere
set fo=tcrqnmM " see help formatoptions (complex)
set linebreak " wrap long lines at a character in 'breakat'
set textwidth=500 " maximum width of text that is being inserted
au FileType mail setl textwidth=78
-" set ai " autoindent
+set ai " autoindent
" set si " smartindent
" set copyindent
set wrap " wrap lines
@@ -865,7 +865,7 @@ map <leader>s? z=
""""""""""""""""""""""""""""""
" => javacomplete.vim
""""""""""""""""""""""""""""""
- let g:java_classpath = "/opt/android-sdk/platforms/android-16/android.jar"
+ " let g:java_classpath = "/opt/android-sdk/platforms/android-16/android.jar"
""""""""""""""""""""""""""""""
" => yankring.vim
@@ -1025,7 +1025,6 @@ augroup development
autocmd BufRead *.vapi set efm=%f:%l.%c-%[%^:]%#:\ %t%[%^:]%#:\ %m
autocmd BufRead,BufNewFile *.vala setl et ts=4 sts=4 sw=4 nu cindent cino=(0 filetype=vala
autocmd BufRead,BufNewFile *.vapi setl et ts=4 sts=4 sw=4 nu cindent cino=(0 filetype=vala
- autocmd Filetype java setlocal omnifunc=javacomplete#Complete completefunc=javacomplete#CompleteParamsInfo
autocmd FileType vala setlocal cindent
" indentation for genie: genie.vim
View
43 ftplugin/java.vim
@@ -0,0 +1,43 @@
+setlocal completeopt=menuone,longest
+setlocal softtabstop=4
+setlocal tabstop=4
+setlocal shiftwidth=4
+setlocal expandtab
+setlocal omnifunc=javacomplete#Complete completefunc=javacomplete#CompleteParamsInfo
+set cinoptions+=j1
+
+
+" ECLIM stuff
+nnoremap <silent> <buffer> <leader>p :JavaImport<cr>
+nnoremap <silent> <buffer> <leader>d :JavaDocSearch -x declarations<cr>
+nnoremap <silent> <buffer> <cr> :JavaSearchContext<cr>
+nnoremap <silent> <leader>jv :Validate<cr>
+nnoremap <silent> <leader>jc :JavaCorrect<cr>
+
+" highlighting stuff
+let java_highlight_all=1
+let java_highlight_functions="style"
+let java_allow_cpp_keywords=1
+
+" optional
+let java_mark_braces_in_parens_as_errors=1
+let java_highlight_debug=1
+let java_ignore_javadoc=1
+let java_highlight_java_lang_ids=1
+let java_minlines = 150
+
+if glob('AndroidManifest.xml') =~ ''
+ if filereadable('project.properties')
+ let s:androidSdkPath = '/opt/android-sdk'
+ " the following line uses external tools and is less portable
+ "let s:androidTargetPlatform = system('grep target= project.properties | cut -d \= -f 2')
+ vimgrep /target=/j project.properties
+ let s:androidTargetPlatform = split(getqflist()[0].text, '=')[1]
+ let s:targetAndroidJar = s:androidSdkPath . '/platforms/' . s:androidTargetPlatform . '/android.jar'
+ if $CLASSPATH =~ ''
+ let $CLASSPATH = s:targetAndroidJar . ':' . $CLASSPATH
+ else
+ let $CLASSPATH = s:targetAndroidJar
+ endif
+ end
+endif
Please sign in to comment.
Something went wrong with that request. Please try again.