Sunday, August 28, 2011

Editing Aptana Key Shortcuts and rebinding commands such as open resource

Being used to eclipse pdt, the open resource command is an indispensable feature. You can open files by typing a few letters and matching filenames start appearing.

Conviently it's mapped to Control+Shift+R

Unfortunately, in Aptana, Eclipse and the Rails workspace, two other commands are bound to this same shortcut. Eclipse, being smart, will create a pop up menu with each of these commands and you can select the one you want with the mouse (typing 0,1,2 will do the same).

Anyone trying to keybind, or replace the shortcut will find that none of the Eclipse GUI menus will allow you to change it.

Edit:  One extra step, you need to download the bundle with eclipse in order to view in the Documents dir.
Click on Commands -> Select Rails or Ruby from the menu -> Edit this bundle.

Take note of the other menu items.
Mine were
Run Rake Task 1
Run Focused Unit Test 2
Open Resource 3

Aptana saves all the bundle scripts in this directory

~/Documents/Aptana Rubles/ruby.ruble/commands/

You will find all the aptana scripts *.rb


and change '+R' in

cmd.key_binding = 'CONTROL+M2+R'
cmd.key_binding = 'M1+M2+R'

to '+Y' or another key

1 comment:

steveapel said...

Thanks Bunwich! This has been annoying me for months!