Search code examples
sublimetext3babeljssyntax-highlighting

Sublime Text syntax highlighting html files as babel/javascript


Now that I have Babel installed for my React development I noticed that when I open .html files the syntax highlighting is set to javascript (babel) instead of HTML. How can I fix this? Here are also a couple of images that might help. Also a little extra thing, I am using the Afterglow theme for sublime text, and how can I remove the annoying padding on the last image underneath the tabs? You can see a few pixels of space which really annoys me.

enter image description hereenter image description here

enter image description here


Solution

  • You have probably overridden the default language settings for HTML files. You can verify this in the Syntax settings.

    1. Open the View menu
    2. Open the Syntax sub-menu
    3. Open the settings for HTML

    If my assumption is true, edit (or delete?) the settings for HTML.

    Otherwise, you can assign a syntax to an extension through the same menu.

    1. Open a HTML file
    2. Open the View menu
    3. Open the Syntax sub-menu
    4. Select HTML in the Open all files with current extension as… sub-menu