Posts Tagged Eclipse

Fun with eclim

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:

let g:EclimBrowser='xdg-open'
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:

map <C-\> :tab split<CR>:exec("tag ".expand("<cword>"))<CR>
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.

, ,

2 Comments

Eclipse with GTK+ 2.18

Lately I noticed Eclipse having some issues such as not being able to confirm certain dialogs or press certain buttons. It made Eclipse extremely annoying to use. Before I found the relatively easy fix, I was reduced to clicking the button and the pressing enter to move past the screen, not exactly a desirable scenario to perform every 5 minutes if for example your exporting jars from Eclipse.

The fix is pretty easy, just add GDK_NATIVE_WINDOWS=1 to Eclipse’s launch script.

For example, here’s my launch script:

File: <em>/usr/local/bin/eclipse</em>

#!/bin/sh
cd /home/ken/eclipse && GDK_NATIVE_WINDOWS=1 exec ./eclipse $@

,

1 Comment

Minor annoyance about Eclipse

Eclipse is an excellent Java IDE that I use almost everyday, but I do have some minor quarrels with it. The first complaint has to be the lack of color scheme support. Sometimes I just can’t stand staring at black on white for hours on end and desire a color scheme for Eclipse. Unfortunately Eclipse does not support such a thing, only setting each color manually. While it is possible to technically import someone’s preferences as a “color scheme”, you can only export/import the entire range of preferences and not just specifically color. This is not an ideal solution.

I am wanting something like the dark spectrum color scheme from vim or Tango Oblivion from gedit. I find these two very nice dark themes that would be great for those long sessions in eclipse.  Unfortunately I’ve not a found a way to do this, and I am vastly too lazy to manually convert each little color to the correct value in eclipse. That would be extremely boring, tedious, and frustrating trying to get it right.

I have been recommended to take a look at Eclim to see if it would fit my needs. It seems like an interesting effort and I would sort of love to have vim with eclipses integration functionality but it just seems like a whole lot of work for what you get. So for now I must stare at this black on white color scheme in eclipse until a future release perhaps supports color schemes natively.

Perhaps I can blame the colors for writing such horrible code ;)

,

7 Comments