Home Download Buy Blog Forum Support

Keybinding to change Syntax

Keybinding to change Syntax

Postby layne on Tue Jan 04, 2011 6:41 pm

Hey all,

I can't find this feature, so I'll ask you ;)

Is there any existing key binding to change the syntax? Or how can I create that?
// my Blog //
layne
 
Posts: 39
Joined: Tue Jan 04, 2011 3:00 pm
Location: NRW // GER

Re: Keybinding to change Syntax

Postby jps on Wed Jan 05, 2011 12:14 am

You can either use the menu (Alt+v,y,then select the syntax), or bind a key to "setFileType", for example:

Code: Select all
<binding key="ctrl+t" command="setFileType Packages/Python/Python.tmLanguage"/>
jps
Site Admin
 
Posts: 3077
Joined: Wed Mar 19, 2008 12:33 pm

Re: Keybinding to change Syntax

Postby layne on Thu Jan 06, 2011 1:01 pm

jps wrote:You can either use the menu (Alt+v,y,then select the syntax), or bind a key to "setFileType", for example:

Code: Select all
<binding key="ctrl+t" command="setFileType Packages/Python/Python.tmLanguage"/>


Thanks, but that don't work with Sublime Text X Alpha, version 20110106 I think?
layne
 
Posts: 39
Joined: Tue Jan 04, 2011 3:00 pm
Location: NRW // GER

Re: Keybinding to change Syntax

Postby jps on Thu Jan 06, 2011 9:11 pm

For Sublime Text X, the command is "set_file_type"
jps
Site Admin
 
Posts: 3077
Joined: Wed Mar 19, 2008 12:33 pm

Re: Keybinding to change Syntax

Postby bperucchi on Thu Mar 01, 2012 1:57 pm

Whats's the hole command to connect key binding with set_syntax ?

thanks
bperucchi
 
Posts: 1
Joined: Thu Mar 01, 2012 1:54 pm

Re: Keybinding to change Syntax

Postby jbjornson on Thu Mar 01, 2012 2:08 pm

Try adding this to your key mappings:
Code: Select all
{ "keys": ["ctrl+shift+y"], "command": "show_overlay", "args": {"overlay": "command_palette", "text": "Set Syntax: "} }


The shortcut will bring up a quick panel where you can select (or type) the syntax to apply to the current view.
jbjornson
 
Posts: 353
Joined: Tue Oct 27, 2009 4:25 pm
Location: Zurich, Switzerland


Return to Ideas and Feature Requests

Who is online

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