Sunday, May 10, 2015

Install SublimeLinter in Sublime Text 3 in Windows 7

SublimeLinter is a framework plugin for Sublime Text that allows for the use of various linters to find errors in code.  This is why SublimeLinter is a very handy plugin to install despite a somewhat convoluted installation process.

To use recent versions of SublimeLinter one will need to install SublimeLinter and the SublimeLinter interface add-ons for the specific linters you wish to use, preferably through Package Control, and also install or have on hand the linters themselves.

For example to check HTML in Sublime Text one may wish to install HTML Tidy.  To do so download through Package Control or through their website and install/extract the following:

1. SublimeLinter
2. SublimeLinter-HTML-Tidy
3. HTML Tidy

Adding Linter Path to SublimeLinter in Sublime Text 3 in Windows 7

To make sure SublimeLinter can access HTML Tidy, the location path to tidy.exe needs to be added to the SublimeLinter.sublime-settings file. In Sublime Text right-click on the screen to bring up the right-click context menu and then select SublimeLinter - Open User Settings to open the SublimeLinter.sublime-settings file. Find the portion that looks like the following:

        "paths": {
            "linux": [],
            "osx": [],
            "windows": []
        },

If using Windows, insert the location of the HTML Tidy folder.  For example if tidy.exe and its accompanying files were extracted and then moved to a folder called HTML Tidy in C:\Program Files one would change alter the above to look like

        "paths": {
            "linux": [],
            "osx": [],
            "windows": [
                 "C:\\Program Files\\HTML Tidy"
            ]
        },

Notice the double backslashes.  The extra slashes are used for coding escape.  Save the file then exit Sublime Text. Restart. SublimeLinter should be working.  Try it out by right-clicking to bring up the right-click context menu access to SublimeLinter. Verify it is working by typing out some incomplete code and running SublimeLinter.  It should display the mistakes.

Links:

No comments:

Post a Comment