0

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.

1 Answer 1

2

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

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks a lot, after google a bit around and trying several kinds of RegExpressions around I got a solution with ${1/[A-Z]/\L$0/}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.