Sublime Forum

Typing accented characters in ST

#1

Just hit a (hopefully minor) stumbling block: entering some content on a page, I needed to type an “é.” I’m on Mac and this is usually done by typing “option+e,” then “e.” You use similar key combinations to get other accents:

option+`, e = “è”
option+i, e = “ê”
option+u, e, = “ë”
etc.

None of these work in ST. I thought it might be possible to create some key bindings to handle such accented characters and searched a bit but did not find a solution (though someone did mention that they had done so). I did find code for a great “open in browser” command, though. :smile: So, my question:

Can I do this with key bindings? If so, could someone explain how? As I’ve been using these key combinations for about 25 years, I’d like to stick with them if at all possible.

Thanks in advance for any help.

0 Likes

#2

Well, I found a solution. Here are key bindings for the accents used in French, minus the cédilla (“ç”) which already works, and that allow me to keep the traditional Mac key combinations mentioned above:

{ "keys": "alt+`,a"], "command": "insert", "args": {"characters": "à"} },
{ "keys": "alt+i,a"], "command": "insert", "args": {"characters": "â"} },
{ "keys": "alt+e,e"], "command": "insert", "args": {"characters": "é"} },
{ "keys": "alt+`,e"], "command": "insert", "args": {"characters": "è"} },
{ "keys": "alt+i,e"], "command": "insert", "args": {"characters": "ê"} },
{ "keys": "alt+`,e"], "command": "insert", "args": {"characters": "ë"} },
{ "keys": "alt+u,i"], "command": "insert", "args": {"characters": "ï"} },
{ "keys": "alt+i,i"], "command": "insert", "args": {"characters": "î"} },
{ "keys": "alt+i,o"], "command": "insert", "args": {"characters": "ô"} },
{ "keys": "alt+`,u"], "command": "insert", "args": {"characters": "ù"} },
{ "keys": "alt+i,u"], "command": "insert", "args": {"characters": "û"} },
{ "keys": "alt+u,u"], "command": "insert", "args": {"characters": "ü"} }

Note that these are for lower case characters only. Upper case could be easily added, as could the accented characters of other languages. I will probably get around to them as needed.

0 Likes