Sublime Forum

Key Bindings

#1

Hi,
I would like to add a key binding to switch between English and French dictionary, is it possible? If so, how should I proceed?
Currently, I do it through the menu but it takes several clicks…
Thanks,
Carl

0 Likes

#2

Take a look at the documentation for key bindings and file type preferences, which are linked to from the support page.

In essence, you’ll want to bind a key to something like:

<binding key="ctrl+t,f" command="set dictionary 'Packages/User/mydict.dic'"/>
<binding key="ctrl+t,e" command="set dictionary 'Packages/Language - Engish/en_US.dic'"/>
0 Likes

#3

I have the following in my “User Key Bindings” file:

<binding key="ctrl+alt+f" command="set dictionary 'Packages/Language - French/fr_FR.dic'"/> <binding key="ctrl+alt+e" command="set dictionary 'Packages/Language - Engish/en_US.dic'"/>

Pressing “Ctrl + Alt + f” or “Ctrl + Alt + e” does nothing :frowning:

0 Likes

#4

I just noticed that if I put the bindings in the “Default Key Bindings” file they work!

Do I need to do anything special to make sublime use the “User Key Bindings” file?

0 Likes

#5

My bad, I was missing the opening and closing bindings tag.

<bindings> <binding key="ctrl+alt+f" command="set dictionary 'Packages/Language - French/fr_FR.dic'"/> <binding key="ctrl+alt+e" command="set dictionary 'Packages/Language - Engish/en_US.dic'"/> </bindings>

works!

0 Likes