Sublime Forum

Keybindings for syntax

#1

I can’t find a good reference to the list of commands that can be used in keybindings. I’d like to bind C++ syntax to a key or have an easy way to set the syntax. Or is the recommended method to immediately save new files with an appropriate extension?

0 Likes

#2

You can make a key binding for this (there are other threads with details IIRC), but the simplest keyboard driven way is to use the Command Palette (via the Tools menu), and type in the syntax you’d like to apply.

0 Likes

#3

I managed to get this to work in the interactive console, now trying to figure out how to map it to a key. Sorry if this is too basic, I’ve had the editor 2 days now.

view.set_syntax_file(‘Packages/C++/C++.tmLanguage’)

0 Likes