Sublime 3 Text: SublimeLinter on Windows Troubleshoot

Sublime 3 Text: SublimeLinter on Windows Troubleshoot

SublimeLinter is a plugin for Sublime Text 3 that provides a framework for linting code.

Full documentation can be found here.

But docs aside, SublimeLinter is a very moody piece of software to get it working.

If you do not believe me, just google and you see whole bunch of people looking for help.

Heck, even official docs have a sizable troubleshoot section.

I myself also had problem with installing it.
It was one of these problems, that are extremely hard to find, since they do not give any hints as to, what is not working.

Here is how I got it working.


Install SublimeLinter framework

Hit ctrl+shift+p and select install.
Then select SublimeLinter to install it.

Install selected plugin for linter framework.

Follow same procedure as above and select proper plugin for your programming language.
In my case I chose: sublimelinter-php.

Make SublimeLinter framework aware of location your language executable.

In my case it was php.exe.

There are two ways:

Way 1: via SublimeLinter Settings

Open: Preferences->Package Settings->SublimeLinter->Settings
Add path to folder with php.exe to: Paths->Windows, e.g. “C:/xampp/php”

Way 2: via Windows global System Variables ‘path’
  1. hit ‘Start’ button, one with Windows logo, usually located to the left of Space bar.
  2. on the left-bottom write: ‘sysdm’ and hit ‘Enter’
  3. open tab: Advanced
  4. click button: ‘Environment Variables’
  5. in bottom list: ‘System Variables’ find item: ‘Path’, select it and hit button ‘Edit’
  6. at the end after last semicolon (if missing add it) add path to your PHP folder with php.exe, e.g.: ‘C:/xampp/php’
  7. click OK – click ‘Apply’, you are done here
Make sure that your php file in Sublime Text 3 has a proper syntax set for it.

Crazy, but necessary.
I was totally fooled by the fact, that color coding worked just fine.
So, I assumed, that Sublime Text 3 recognizes my files as php files.

To my surprise, it was not.
All php files were being recognized as Laravel blade files:

st3blade

Most likely, because I have installed this addon:

bladeh

… which is actually totally not needed with my theme.

Now, how to make it work.

There are 2 ways to do this.

Using ‘command palette’.
  1. ctrl+shift+p
  2. search for and select  ‘set syntax: php’
Using Sublime Text 3 menu.

If you look two images up, where I showed you ‘Laravel Blade’ file type and look at top-right portion of that image, you will see:

  • ‘open all with current extension as ..’

Click in and in newly opened panel select ‘php’ – not blade!

If after action above, you loose your blade highlighting, you are welcome to try my customized theme – if you like dark themes.


Same procedure may apply to other languages, if you experience similar problem.