h1

gvim in eclipse

August 12, 2010

I spent the morning trying to get eclipse work like vim. Here are the tweaks I had to do to get it almost like how I like it. These instructions are good for Ubuntu 10.04, they may differ on other platforms.

1. Make the package explorer open on a key press.
Minimise the package explorer window so its not eating up the screen. You can bring it back pressing SHIFT-ALT-Q then P. This setting is hidden in the Windows->preferences->General->Keys->Show View (View: Package … area. To minimise the package explorer window without the mouse, press ESC.

2. Make files open using gvim instead of the usual eclipse editor
Install gvim (sudo apt-get install gvim)
Then in eclipse: Windows->preferences->General->Editors->File Associations
Add each file type you need to open with gvim (e.g. *.java) and in the associated editors make Vim the default.

3. Make the vim editor look nice
The default colour scheme is awful. I had to add the following items to my ~/.gvimrc file

syntax on
colorscheme slate
:set guioptions-=T "Remove toolbar
:set guioptions-=m "Remove the menu bar
:set clipboard=unnamed

The clipboard option allows yank and paste between eclipse windows which didnt work without it.

And thats about it

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: