Keybinding not shown in Resolver


#1

Hi there, I am stuck on a little problem and couldn’t find the help on the forums.

I wrote a little function in my init file that puts a passphrase into the clipboard (I am full aware that this is not a save way to store passwords).

atom.commands.add ‘atom-text-editor’, ‘load-passphrase’, ->
atom.clipboard.write(‘phrase’)

The function is indeed loaded and I can use it with Ctrl-Shift-P (I use Ubuntu) and then selecting the function. It works just fine.

Next I try to add it to my keymap.cson, where, after using the key resolver to find an empty spot. Ctrl-i seems to work. So I have now

‘atom-text-editor’:
‘enter’: ‘editor:newline’,
‘ctrl+i’: ‘load-passphrase’

When now pressing Ctrl-Shift-P it shows my function and also the correct key combination behind it. However using the key combination doesn’t work. Even the key-resolver doesn’t see the function when I press ctrl-i, so there is no conflict, but nothing happens either. Thanks in advance for any support.


#2

Also I realized that the comma after the first command is wrong, but removing it didn’t solve the issue.


#3

Just solved it myself. The ‘+’ should have been a ‘-’. Now it works nicely


#4

One minor thing. You should prefix your custom command, for example: custom:load-passphrase. This way it won’t interfere with a package that decides to add that command as well.