sublimetext3 - Sublime Text 3 custom PHP auto-completion does not work -
here's default auto-completion "switch":
switch (variable) { case 'value': # code... break; default: # code... break; } but wish turn just:
switch () { case '': break; case '': break; } because don't modify "#code here..." every time.
i navigated
"c:\users\user\appdata\roaming\sublime text 2\packages\php"
and opened "switch(-).sublime-snippet" , modified into:
<snippet> <content><![cdata[switch ($0) { case '$0': break; case '$0': break; }]]></content> <tabtrigger>switch</tabtrigger> <scope>source.php</scope> <description>switch …</description> but nothing works. there syntax error?
or modify wrong file?
if tagged question correctly, modified wrong file - need edit sublime text 3 version. bit more difficult directly, since file wrapped in .sublime-package zip archive. around this, install package control (if haven't already), install packageresourceviewer plugin. open command palette, type prv bring packageresourceviewer options, select open resource, navigate down php , select switch(-).sublime-snippet option. edit liking, save it, , should set.
you want set tab stops differently. try instead:
<snippet> <content><![cdata[switch ($1) { case '$2': $3 break; case '$4': $5 break; ${0:default:} }]]></content> <tabtrigger>switch</tabtrigger> <scope>source.php</scope> <description>switch …</description> </snippet> now, can tab through different areas, filling in info go, ending @ bottom default option, can hit delete on erase if don't want it. original version, after typeing switchtab, have ended 3 different cursors, 1 @ each of $0 locations. check out snippets reference more information.
Comments
Post a Comment