Is there a way to get the Atom editor to insert a custom Unicode character when you press a shortcut key? I'm trying to make Cmd-\ insert a lambda (λ).
Displaying Invisible Characters in Atom To display spaces, tabs and linebreaks in Atom, you'll need to go to “Settings” -> “Editor” and then scroll down until you find the “Show Invisibles” option.
In the "Script" package, The keyboard shortcut to "Run Script" is shift+ctrl+b .
You can create a custom command and then map that command to the desired key. To add the custom command you can add this to your init.coffee
:
atom.commands.add 'atom-text-editor',
'custom:insert-lambda': (event) ->
editor = @getModel()
editor.insertText('λ')
Then you can add the key mapping in your keymap.cson
:
'atom-text-editor':
'cmd-\\': 'custom:insert-lambda'
After restarting or reloading the window to load the new init.coffee
, things should work for you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With