Sublime Forum

Trivial but annoying issue with PHP 'for' snippet

#1

Whenever I type ‘for’ and press TAB to get the snippet I end up with a space at the end of the first line. When writing PSR2 compliant code this becomes a nuisance. I usually just fix it myself but could this be fixed for a future build please?

0 Likes

#2

You can overwrite how this works by doing the following (assuming you are on ST3 & Windows):

  1. open the install path for sublime (that is on %programfiles%\Sublime Text 3)
  2. Open Packages folder
  3. Search for the package you want to change (in this case is PHP) then open it (is a zip file with a changed extension, so 7zip or winrar will do)
  4. Now go to Sublime, and from top menu pick Browse Packages
  5. If is not present, create a folder that have the same name as the package you want to change (PHP)
  6. Copy the snippet you want to change from the archive in the newly created folder ( e.g. for(-).sublime-snippet )
  7. Change the snippet to work as you want.
  8. Enjoy :smile:
0 Likes