Question

I'd like to generate a list of key bindings that are unpopulated in SlickEdit 18.0.0+

Is there a simple way to do this?

Currently, when I write a new macro, I have to hunt and peck trying various combinations to find if there is a key sequence I can live without.

The only thing I found on the interweb was a mailing list feature request for this, and the SlickEdit employee recommended using the command line interface instead of a bound hotkey. Not quite what I'm hoping for.

Was it helpful?

Solution

I am using v17 but 'unused keys' is an infinite set since it is a multi-key hotkey system. I imagine it can be done based on the existing key-tree, but I would not want to write it.

If you are looking for a quick manual way to find empty key-paths, use the following:

// list keys in sorted fashion to new buffer
_command list_keydefs()
// Find command assigned to a key-path
_command what_is()
// Find commands assigned to key-paths
_command what_are()
// Find key-paths assigned to command
_command where_is(_str commandName='', _str quiet='',_str separatorChar=',') name_info(COMMAND_ARG',')
// Bind to a key
_command bind_to_key(_str commandName='') name_info(COMMAND_ARG',')
// Bind current word (proc name) to key
_command bind_cur_word_alt(){
  if (command_state()) {
    return(0);
  }
  _str s=cur_word(0);
  if (s==''||!is_cmd(s)) {
    s=current_proc_name(false);
  }
  if (!is_cmd(s)) {
    _message_box(s' is not a command');
    return(0);
  }
  _str sa=letter_prompt('Number of Keys or 0 to Quit','1234567890');
  if (sa==''||sa=='0') {
    _message_box(1);return(0);
  }
  _str ss='-'sa' -r 's;
  bind_to_key(ss);
  ss=where_is(s,1);
  sticky_message(ss);
}
// utils
_command is_cmd(...){
  _str p=current_proc(false);//was current_proc_name
  if (arg()==1) {
    p=arg(1);
  }
  return(find_index(p,COMMAND_TYPE)!=0);
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top