Author Topic: Can you list all current key bindings?  (Read 5857 times)

pearish

  • Community Member
  • Posts: 11
  • Hero Points: 0
Can you list all current key bindings?
« on: September 06, 2006, 12:36:31 am »
I'm brand-new to SlickEdit, and I'm having difficulty with the UI for key bindings. Ideally, I'd like to get a text file list of all commands and their associated key bindings, so that I could easily search by command and by key combinations. Why? because I would like to add key bindings, but I don't know if they are currently in use. In addition, I haven't found a way to easily find out which command is associated with a particular key combination. It seems that you can only find a key combination if you already know the command.

Graeme

  • Senior Community Member
  • Posts: 2532
  • Hero Points: 329
Re: Can you list all current key bindings?
« Reply #1 on: September 06, 2006, 01:25:50 am »
I'm brand-new to SlickEdit, and I'm having difficulty with the UI for key bindings. Ideally, I'd like to get a text file list of all commands and their associated key bindings, so that I could easily search by command and by key combinations. Why? because I would like to add key bindings, but I don't know if they are currently in use. In addition, I haven't found a way to easily find out which command is associated with a particular key combination. It seems that you can only find a key combination if you already know the command.

Press escape to bring up the slickedit command line.
Type list-keydefs to see all your current keybindings.
To find out what command is bound to a particular key, on the command line type what-is <return>, then press the key combination.
To show the Slick C source code for a particular function or command some-name, on the command line type fp some-name     

Another way to find what a particular key combination does is to use the key binding dialog -  select any command, (e.g. lets pick abort) - the dialog says "abort is not bound to a key" - click "Add Key or Mouse Click" button, press the key combination you want to check out and the dialog will tell you if that key is bound to anything.  If you want, you can then click unbind to unbind that key combination if it's already used.

I don't believe there's a way to get a list of all commands that you see in the key bindings dialog other than by writing some macro code similar to what you can see in _b2kcommand.on_create in the b2k.e module in the slick macros directory.  The names are taken from the names table.  If you write your own macros their names will be added to the names table and appear in the key bindings dialog.  Probably the line
p_cb_list_box._insert_name_list(COMMAND_TYPE);
adds all "command" type names from the names table to the list box - so you could probably write your own macro to generate a list of all commands if you wanted.

You can also see your key bindings in vusrdefs.e in your config directory - it gets updated when slick closes or when you save your configuration.

Graeme

 

pearish

  • Community Member
  • Posts: 11
  • Hero Points: 0
Re: Can you list all current key bindings?
« Reply #2 on: September 06, 2006, 03:47:22 pm »
Thank you for the information. It almost helped  ;)
Here are the problems I encountered:
1) "escape" didn't give me a command line because I am using Vim emulation mode. Typing the "escape" character just gives the message, "already in command mode".
2) I don't have any file named vusrdefs.e (that I can find)

I tried your directions after switching back to the default CUA "emulation", and it worked like a champ! Exactly what I'm looking for - but in the Vim emulation case.

Graeme

  • Senior Community Member
  • Posts: 2532
  • Hero Points: 329
Re: Can you list all current key bindings?
« Reply #3 on: September 06, 2006, 10:03:30 pm »

According to my help file, Esc Ctrl-[ gets command mode in VIM emulation - search for Vim in the help.

On Linux, I think the file vunxdefs.e is the equivalent of vusrdefs.e on Windows.

Graeme

Graeme

  • Senior Community Member
  • Posts: 2532
  • Hero Points: 329
Re: Can you list all current key bindings?
« Reply #4 on: September 06, 2006, 11:02:54 pm »

Or perhaps Ctrl-A - "cursor to command line toggle"

Graeme