views:

396

answers:

2

Hi guys.. I've just started playing with macros in IntelliJ. I recorded several then played back until I decided to add keymap shortcuts to my macros. I went to Settings and pressed Alt+C to add a new child map because I couldn't edit the parent. Since then the macros are no longer accessible from the Tools menu, not to mention that the shortcuts don't work. I tried removing the shortcuts from the keymap but even though I press Alt+R or Alt+L, it still does not revert them back. And TAB has stopped working .. when writing sout +TAB ..nothing happens anymore... HELP

+1  A: 

You can try to use the default keymap. When you modify the default keymap, a copy is created with your settings.

If that is not working, you can try to quit IntelliJ and to delete this file:

/.IntelliJIdea90/config/options/macros.xml

and check also for the folder

/.IntelliJIdea90/config/keymaps

To find the location of the config folder you should look for the file : idea.properties in the folder where the main executable for idea is.

Look for the line:

# path to IDEA config folder. Make sure you're using forward slashes
idea.config.path=${idea.home}/.IntelliJIdea90/config

And this is the location of the config. folder.

Restart IntelliJ.

Take a copy of any file you are going to delete!

dawez
Thanks.. deleting the macros.xml from options has reenabled the macros from Tools. sout+TAB is still not working - I believe I deleted several keymaps when I was editing. Is there any way I can retrieve all the keymaps that IntelliJ comes with? Thanks a lot!
Iulia
What is sout+TAB ? The ALT+TAB in IDEA9 is activating the switcher. You can look in keymap settings / Other / Switcher and put back ALT+TAB.
dawez
The default KEYMAP is not allowed to be modified so if you choose DEFAULT as keymap you will find the original settings.
dawez
sout +TAB is shortcut for writing "System.out.println("")".. and psvm +TAB would expand into "public static void main(String[] args)".. it's not part of the default keymap
Iulia
You can write sout and then press Ctrl+J and get a drop down menu from which you can choose but sout+TAB is quicker.. I might have to make that a question in its own
Iulia
A: 

Sorted! sout+TAB is part of live templates..

If you open the IDE Settings window, you will see Live Templates.. Under output you should find sout(Prints a string to System.out).. if not, click Add and then type sout for the Abbreviation section, type in a description and then for the template text put System.out.println("$END$");

I use the Default keymap in IntelliJ now...

Thought this might help someone...

Iulia