pertrai1 pertrai1 - 1 year ago 102
HTML Question

Keymap Sublime Text 2 File Type?

I am working on setting up my own keymaps and was wondering if there is the option to set keys to switch the file type that is being worked on. So for example, if I have a regular plain text file and want it to be a css file, I would have a keymap that would change the document type to css. Possible? If so, please explain to me how you have done this.


Answer Source

While the individual shortcut solution is great, it requires editing the config files and most importantly remembering all the shortcuts you create for each sytax.

In the case of switching file formats it might be more useful to quickly access the required format via the command palette:

  • Press CTRL+SHIFT+P to bring up the Command Palette
  • Type CSS to highlight Set Syntax: CSS command
  • Press ENTER

This is great because it provides quick access to all the formats available. Start typing set syntax... and all the available formats will be shown.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download