How to customize Sublime Text default Auto-complete

December 22, 2014

I use Sublime text 3 every day, especially the JavaScript autocomplete feature.

For the if-statement, the default completion popup has an unnecessary semicolon at the end.

if (true) {};

Using JSHint, it gives me an error for most of the code I have written.

It is counterproductive to manually delete it every time.

Here is a solution to this problem:

  1. Go to PreferencesBrowse Packages to open the Sublime Text Folder.
  2. Find the folder called JavaScript (if it doesn’t exist, create one).
  3. In the folder, open if.sublime-snippet (if it doesn’t exist, create one)
  4. Delete the semi-colon so your snippet now looks like this:

<![CDATA[if (${1:true}) {${0:$TM_SELECTED_TEXT}}]]> if source.js if

Originally published at victorleungtw.com on November 25, 2014.


Written by Victor Leung who is a keen traveller to see every country in the world, passionate about cutting edge technologies. Follow me on Twitter