pythonsublimetext3sublime-anaconda

Can a second shortcut key be added to an Anaconda keymap?


The following entry exists in the default keymap for the Anaconda plugin for Sublime (it brings up the documentation for a method):

{
    command": "anaconda_doc", "keys" ["ctrl+alt+d"], "context: [
         {"key": "selector", "operator": "equal", "operand": "source.python"}
    ]
}

I'd like to add ["ctrl+."] to the keys, so that I can press either ctrl+alt+d or ctrl+. to bring up the documentation. Is there a way to add an or condition to the keys entry?

I've tried ["ctrl+alt+d", "ctrl+."], but this just translates to ctrl+alt+d+.. None of my other attempts worked at all.


Solution

  • There is no way to add an "or" to the keys entry - to get another key combination to do the same thing, you have to duplicate the binding:

    {
        "command": "anaconda_doc", "keys" ["ctrl+alt+d"], "context": [
             {"key": "selector", "operator": "equal", "operand": "source.python"}
        ]
    },
    {
        "command": "anaconda_doc", "keys" ["ctrl+."], "context": [
             {"key": "selector", "operator": "equal", "operand": "source.python"}
        ]
    }