I would like to learn whether it's possible to set up a key binding in Sublime Text 2 to change a file type. To clarify further, I am not trying to alter a particular file type settings via a key binding but change the file type itself.

When I open Sublime Text 2, my default file type is plain text. This works for my needs. But I would like to create a shortcut (key binding) to be able to quickly switching to a different file type (e.g. Java or SQL). As of right now, I have to make the selection via mouse.

enter image description here

Thanks for any tips in advance.

1 Answer 1


Here's the answer if anyone is interested.

It turns out that Sublime Text 2 has a built-in functionality for switching file types in the Command Palette.

So to switch from plain text file type to xml:

1) Ctrl+Shift+P

2) type "xml"

3) select "set syntax:XML"

enter image description here

note: for SQL file type, type in "ssql"

It's not a single key binding answer but it certainly does the trick for my needs.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .