Home Download Buy Blog Forum Support

Key Bindings

Key Bindings

Postby carlbolduc on Fri Feb 26, 2010 2:23 am

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
carlbolduc
 
Posts: 7
Joined: Mon Aug 31, 2009 8:06 pm

Re: Key Bindings

Postby jps on Fri Feb 26, 2010 11:29 am

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:

Code: Select all
<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'"/>
jps
Site Admin
 
Posts: 3071
Joined: Wed Mar 19, 2008 12:33 pm

Re: Key Bindings

Postby carlbolduc on Wed Mar 03, 2010 8:29 pm

I have the following in my "User Key Bindings" file:
Code: Select all
<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 :(
carlbolduc
 
Posts: 7
Joined: Mon Aug 31, 2009 8:06 pm

Re: Key Bindings

Postby carlbolduc on Thu Mar 04, 2010 4:05 pm

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?
carlbolduc
 
Posts: 7
Joined: Mon Aug 31, 2009 8:06 pm

Re: Key Bindings

Postby carlbolduc on Thu Mar 04, 2010 4:09 pm

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

Code: Select all
<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!
carlbolduc
 
Posts: 7
Joined: Mon Aug 31, 2009 8:06 pm


Return to Technical Support

Who is online

Users browsing this forum: Yahoo [Bot] and 35 guests