Sublime Forum

Keybinding to change Syntax

#1

Hey all,

I can’t find this feature, so I’ll ask you :wink:

Is there any existing key binding to change the syntax? Or how can I create that?

0 Likes

Markdown as default syntax
Soft tabs, selection wrap and switch syntax
#2

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

<binding key="ctrl+t" command="setFileType Packages/Python/Python.tmLanguage"/>
0 Likes

#3

[quote=“jps”]You can either use the menu (Alt+v,y,then select the syntax), or bind a key to “setFileType”, for example:

<binding key="ctrl+t" command="setFileType Packages/Python/Python.tmLanguage"/> [/quote]

Thanks, but that don’t work with Sublime Text X Alpha, version 20110106 I think?

0 Likes

#4

For Sublime Text X, the command is “set_file_type”

0 Likes

#5

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

thanks

0 Likes

#6

Try adding this to your key mappings:

{ "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.

1 Like