Sublime Forum

Snippets vs auto-completion?

#1

I’m a recent TextNate convert and trying to get move my snippets over. The issue I’m having is autocompletion overriding my snippets.

For example the following snippet.

<snippet> <content><![CDATA[ public function set${1:Variable}(\$${1/./\l$0/}) { \$this->_${1/./\l$0/} = \$${1/./\l$0/}; return \$this; }${0} ]]></content> <tabTrigger>set</tabTrigger> <scope>source.php</scopy> </snippet>

At first it’s overwritten by setcookie, commenting that out of the PHP.sublime-completions it then completes to setlocale, then setrawcookie, etc. I could comment all of these out but in time I know an update is going to wipe out all of these changes. Whats the best way for me to handle this issue?

Thanks!

0 Likes

#2

Did you try disabling tab completion?

// When enabled, pressing tab will insert the best matching completion.
// When disabled, tab will only trigger snippets or insert a tab.
// Shift+tab can be used to insert an explicit tab when tab_completion is
// enabled.
"tab_completion": false,

If you put that in the file** User\Base File.sublime-settings** then when you update Sublimetext2 it will not overwrite your settings as they are in your User file

0 Likes