john84
john84

Reputation: 2451

Call SublimeText 2 API commands from Snippet

I just wrote my first SublimeText Snipped and wonder if I can all API commands. In the concrete case I have the following snippet:

<snippet>
    <content><![CDATA[  public function set${1:fieldName}(\$${2:fieldName})
    {
        \$this->_${2:fieldName} = \$${2:fieldName}; 
    }]]></content>
    <tabTrigger>set</tabTrigger>
    <scope>source.php</scope>
    <description>public function set...(...){}</description>
</snippet>

and at the second occurrence of ${2:fieldName} I'd like convert the first char to lower case.

Upvotes: 0

Views: 388

Answers (1)

skuroda
skuroda

Reputation: 19744

There is no API access, but you can do regex substitutions. See the following for additional information.

https://docs.sublimetext.io/guide/extensibility/snippets.html

Upvotes: 2

Related Questions