Have custom keyboard shortcut in Unicode char in Atom

Is there a way to get the Atom editor to insert a custom Unicode character when a keyboard shortcut is pressed? I am trying to make Cmd- \ insert lambda (λ).

+5
source share
1 answer

You can create a custom command, and then map this command to the desired key. To add a custom command, you can add it to your init.coffee :

 atom.commands.add 'atom-text-editor', 'custom:insert-lambda': (event) -> editor = @getModel() editor.insertText('λ') 

Then you can add key mapping in keymap.cson :

 'atom-text-editor': 'cmd-\\': 'custom:insert-lambda' 

After rebooting or reloading the window to load a new init.coffee everything should work for you.

+6
source

All Articles