1

How to edit inbuilt code completion syntax in ST3?

For example: When I work on c file, I type

for

and hit tab, it gives me this:

for (int i = 0; i < count; ++i)
{
    /* code */
}

This hurts my code formatting, and my eyes, what I would like is

for (int i = 0; i < count; ++i){
    /* code */
}

Which file should I edit to do it when working with ST3 on Ubuntu?

1

1 Answer 1

2

Please see my answer here for complete instructions on how to edit snippets in ST3. The package you are looking for is C++, and the snippet to edit is 030-for-int-loop-(fori).sublime-snippet. Change it to the following:

<snippet>
    <description>For Loop</description>
    <content><![CDATA[for (int ${2:i} = 0; $2 < ${1:count}; ${3:++$2}){
    ${0:/* code */}
}]]></content>
    <tabTrigger>for</tabTrigger>
    <scope>source.c, source.objc, source.c++, source.objc++</scope>
</snippet>

and you should be all set.

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

Comments

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.