I recently switched editors from Netbeans IDE to Sublime Text 2. In Netbeans when coding PHP if I had a syntax error it would have an error icon at the start of that line.
Sublime Text 2 doesn’t seem to do this out of the box. What plugin do I have to install to get this feature?
In Netbeans you can set up code templates. You will basically write for example something like this:
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script>
and call the template jquery. Then everytime you need to use jquery on a page you just tyoe jquery and hit tab and the script tag will be inserted in that spot.
How to do this type of code template/shortcut in Sublime?
Php Syntax Check
The SublimeLinter plugin supports automatic php syntax checking:
https://github.com/SublimeLinter/SublimeLinter
Template
For javascript sources you can use the cdnjs plugin:
https://github.com/dafrancis/Sublime-Text–cdnjs
More generally, you can create your own templates. Here’s one to accomplish what you’d like. Save this in the User’s folder of your packages directory (go to Preferences -> Browse Packages) under the name “jquery.sublime-snippet”