Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In Sublime, typing <tab> after colon causes 'key => "value"' to appear, why?

In Sublime (I'm using Sublime 3), typing after a colon causes the text 'key => "value"' to appear.

This is an annoying behaviour.

I merely want to indent the text after the colon.

Why is this happening (it must have some key binding as a shortcut)? And how do I remove this behaviour?

Thank you

like image 409
Zack Xu Avatar asked Oct 29 '14 23:10

Zack Xu


2 Answers

Step-by-step instruction:

  1. Install PackageResourceViewer
  2. In the command palette type "prv", select "PackageResourceViewer: Open Resource"
  3. Select your language e.g. "JavaScript"
  4. Select: "Snippets/"
  5. Select the 'offender': "Object-key-key-value.sublime-snippet"
  6. Comment out (use XML/HTML comments, <!-- -->, as it is an XML) or just delete the line containing: <tabTrigger>:</tabTrigger>
  7. Save
like image 62
ellockie Avatar answered Sep 28 '22 09:09

ellockie


As it's a built in package (as @sergioFC said), you will need to extract the file and create an override. Alternatively, use https://sublime.wbond.net/packages/PackageResourceViewer to open the file, and remove the tab trigger. Upon saving it will place the override file in the proper location.

like image 39
skuroda Avatar answered Sep 28 '22 09:09

skuroda