How to set up key bindings to change file type in Sublime Text 2

keyboardkeyboard shortcutssublime-text-2

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.

Best Answer

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.

Related Question