Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Importing Netbeans keymap to Eclipse

I have been a happy NetBeans user for a few years and I am pretty used to the keyboard shortcuts. Is there a way for import my NB preferences, and more specifically the keymap, into Eclipse? I know the opposite is possible.

PS I have to say I do not insist on using Eclipse, but I found the PyDev plugin is superior to NB's python plugin. Could you recommend any good Python IDEs that will act like NB?

like image 911
mbatchkarov Avatar asked Aug 24 '11 11:08

mbatchkarov


People also ask

How do I add a keyboard shortcut in Eclipse?

How do you manage keyboard shortcuts. The main preference page can be found under Window > Preferences > General > Keys (or faster: Press Ctrl+3, type Keys and press Enter). From here you can see all commands and assign/change their associated keyboard shortcuts.

How do I enable shortcuts in NetBeans?

Editing and Refactoring Code in NetBeans To add a keyboard shortcut for a command: Choose Tools | Options and click the Keymap panel. In the Actions panel, navigate to a command that you want to change, and click Add. In the Add Shortcut dialog box, type in the key combination that you want to use and click OK.

What is the shortcut key to run a file in Java NetBeans?

shift-f6 will do it.


2 Answers

Netbeans' preferences can be exported in XML, but it uses different parameter names than those accepted by Eclipse. See this post for information on other python IDE's if you're considering switching beyond Eclipse.

I personally use Komodo-Edit, due to the fact it provides better-than-average code completion.

UPDATE: Sublime-Text 2 has rocked Komodo-Edit right out of my toolkit. It's not a complete IDE (neither is Komodo-Edit), but has IDE-like features that make it ideal for working in Python.

like image 84
strongMA Avatar answered Sep 20 '22 09:09

strongMA


You can import key preferences in Eclipse. Go to file -> Import -> preferences, There you can input a preferences file where one of the sections that this file type supports is "Key Preferences".

Now I don't know which format NetBeans uses when it exports the key prefs file, or exactly which format Eclipse recognizes (It's some xml you need to figure out), but I'm pretty sure you can:

  1. export your keys from NetBeans
  2. Reverse Engineer the Eclipse preferences file format (the keys section) by exporting (file->export->preferences) the current settings.
  3. write code to convert NB export format to Eclipse format..

Good Luck :)

EDIT:

I just looked at my own favorite preferences file. It has a lot of lines like:

<keyBinding commandId\="org.tigris.subversion.subclipse.ui.synchronize" contextId\="org.eclipse.ui.contexts.window" keyConfigurationId\="org.eclipse.ui.defaultAcceleratorConfiguration" keySequence\="ALT+CTRL+K S"/>\r\n

You're going to have a hard time figuring out the commandId and contextId. So scratch that idea..

like image 30
Enrico Avatar answered Sep 22 '22 09:09

Enrico