Posts Tagged vim
Fun with eclim
Posted by Ken in Programming on December 22, 2009
So I just recently tried eclim and I have to say I’m loving it for the java work I normally do. The power of vim with eclipse’s autocompletion support, automatic imports, and javadoc search is extremely handy. I had heard of eclim for awhile, but I just never tried it. Now I regret not trying it sooner as its awesome.
I’m still experimenting with it and digging it. Here’s some settings I’ve made for ease of use in my ~/.vimrc:
nnoremap <F2> <ESC>:JavaDocSearch<cr>
nnoremap <F11> <ESC>:Ant<cr>
nnoremap <F3> <ESC>:JavaImportMissing<cr>:JavaImportClean<cr>
abbr print System.out.println("");<esc>hhi
I also usually use ctags with my projects too. For java I usually use ctags -R --links=yes --java-types=cimp -f tags to generate the tags file and then use in my ~/.vimrc:
set tags=./tags;$HOME
These settings allow me to hit ctrl-\ and jump to the class/method of the file its defined in and open it in a new tab. If its in the same file, I use the normal ctrl-] tag command. The second line has vim search up from the current directory up to my home directory for a file called “tags” which was generated by the ctags command.
For the time being this is looking like it will replace my old eclipse only java environment, and perhaps this will improve my python and other ones too. The ctags alone have made python a lot easier to work with.
