Replacing text while editing


I want to add keyboard shortcuts to replace ‘\alpha’, ‘\beta’, etc. with ‘α’, 'β, etc. while I type.

I’ve tried adding the following to my keymap.cson, but it doesn’t even insert anything.
‘\alpha’: ‘α’

I probably have to make a larger command to delete the preceding text and insert the character(s)… any help on how to do this?


What you want is a snippet, which will replace the text in the prefix with the body.

    prefix: '\\al'
    body: 'α'

With that, you can just type \altab.


Thank you!