Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I've recently switched to Sublime Text 2 for Rails development and I'm trying to understand how to get alternate options for snippets. For example in a rails migration the snippet

mcol + [tab key]

enter image description here

can either remove / add a column. When I tab I get the following output.

remove_column :table, :column [press tab twice to generate add_column]

So there are instructions for tab twice to generate the add_column alternate. I can't for the life of me get the add_column alternate. Does anyone know how this is supposed to work?

Edit: Here is the snippet in question: "Packages/Rails/Migration-Remove-and-Add-Column-(mrac).sublime-snippet"

<snippet>
    <content><![CDATA[remove_column :${1:table}, :${2:column}${3: [press tab twice to generate add_column]}]]></content>
    <tabTrigger>mcol</tabTrigger>
    <scope>meta.rails.migration - meta.rails.migration.create_table - meta.rails.migration.change_table</scope>
    <description>Remove / Add Column</description>
</snippet>
share|improve this question
add comment

1 Answer

I'm not sure how that snippet is supposed to work, it may be broken. I would add a snippet for add_column

Tools > New Snippet...

<snippet>
    <content><![CDATA[add_column :${1:table}, :${2:column}]]></content>
    <tabTrigger>acol</tabTrigger>
    <scope>meta.rails.migration - meta.rails.migration.create_table - meta.rails.migration.change_table</scope>
    <description>Add Column</description>
</snippet>

Save as "Migration-Add-Column-(acol).sublime-snippet" in your "Packages/User" folder.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.