SlickEdit Community
SlickEdit Product Discussion => SlickEdit® => SlickEdit User Macros => Topic started by: Graeme on January 09, 2010, 11:13:01 PM
-
I've been re-organizing my keybindings so I can try and remember them more easily. In the process, I wrote some macros that let me see the key bindings in groups e.g. all key bindings involving the same function key are grouped together.
The macro xkey_bindings_show generates a file group-keydefs.e in your config-folder/keybindings folder - just like the list-keydefs command generates keydefs.e. Unlike keydefs.e, the group-keydefs.e file is not intended to be loaded.
The macro xkey_binding_trainer prompts for a key, then displays a menu of the "key group" and associated commands. e.g. press F1 and you get a menu of F1, S-F1, C-F1 etc. You can execute a command from the menu as well as use it to jog your memory.
It does not handle "composite" key sequences.
e.g. this is what I currently have for the enter key
'ENTER'= split_insert_line;
'S-ENTER'= keyin_enter;
'C-ENTER'= nosplit_insert_line;
'A-ENTER'= what_is;
'C-S-ENTER'= nosplit_insert_line_above;
'A-S-ENTER'= where_is;
'C-A-ENTER'= xkey_binding_trainer;
'C-A-S-ENTER'= xkey_bindings_show;
The macro works for me but there's no guarantee it will work for you so if you have a problem, post it back here and maybe someone can fix it!
Command Name:
xkey_bindings_show
xkey_binding_trainer
Written For:
SlickEdit 14
Description:
See above
Limitations:
Does not handle "composite" key sequences.
Outputs key bindings for "default" mode only.
Installation:
Save the macro file locally and load it via Macro > Load module.
-
Fixed a problem where the xkey_bindings_show command didn't work properly if the group-keydefs.e file didn't already exist. Previously, the group-keydefs.e file would get created if it didn't exist but would be left empty so you would have to run the command twice to get it to work.
Graeme
-
Very handy. Thanks.
-
+1, very helpful.
Had to create directory:
"%USERPROFILE%\My Documents\My SlickEdit Config\17.0.2\keybindings"
-
I've updated the file and fixed the problem of when the keybindings directory doesn't exist.