9

I tend to use lines of hashes and dashes for formatting and breaking up code files (e.g., CSS files):

/* -------------------------------------------------------------------
 * Layout Styles
 * -----------------------------------------------------------------*/

In vim I would use the command 80a-<ESC> which would insert 80 - characters from the location after the cursor.

I've poked around in the Sublime documentation, but haven't come across a good way of replicating the above vim command in subl. Vintage mode does not include support for this command sequence.

Is there a corresponding command that does something similar in Sublime or would a static snippet be the simplest solution?

1 Answer 1

10

I don't think there is any repeat character possibility. To do this with any character I think would require a plugin, but the basic functionality of inserting a big comment block can easily be achieved with a snippet:

Go to New Snippet through the menus and add this code:

<snippet>
    <content>
        <![CDATA[
/* -------------------------------------------------------------------
 * $0
 * -----------------------------------------------------------------*/
        ]]>
    </content>
<tabTrigger>comment</tabTrigger>
</snippet>

then save the snippet in your Packages\User folder, as something.sublime-snippet. Should work straight away, you just have to type comment (or whatever you change it to..) then hit tab, then actually write your comment title.

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

1 Comment

That's sort of what I thought based on the docs. Thanks for confirming!

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.