Sublime Forum

Introducing a New Comment Marker

#1

First, to Jon:

Thanks for the hard work and the awesome product. When I first purchased Sublime Text I was using it to simply edit system conf files. Currently I’m editing a book for a publisher, which means I spend 8-10 hours in your program. Splendid stuff.

The only thing I find lacking at this point in the dev cycle is the ability to select, drag, and drop material (similar to gEdit); perhaps for your wish list?

Question to anyone who can answer:

I work predominantly in AsciiDoc. One day when I have buckets of free time I might try tackling a syntax addon to contribute, but until then…

One common operation I perform is to comment out a range of narly text; the asciidoc comment marker is ‘//’.

So I have to mark the start of the line, break the line somewhere, go back to the head, mark, do-da, do-da.

Is there a simple-ish way to add ‘//’ as a recognized comment marker so I can use Sublime’s built-in menu option Edit >> Comment >> Toggle Block Comment?

I’m not a programmer, so writing something in Python to achieve this is not in my league.

TIA,
/tom

0 Likes

New AsciiDoc Plugin Bundle
#2

I’m not 100% sure if I understand your current process (are you adding line breaks while commenting stuff out?), but what if you just select a bunch of text, hit ctrl+l to break the selection into lines, hit home to move all the selections to the beginning of the line, and then hit ‘//’? Does that do what you want?

0 Likes

#3

@adzenith: workflow as follows,

some text in the file
some more text

// add comment to first line
(delete extra line)
// add coment to second line

In the case of long line, I have to manually split them as the ‘//’ comment marker can only span one line

@sublimator

Thanks so much for the link.

  1. I’m assuming textmate bundles are compatible with Sublime?
  2. I’ve never added a “package” – clone it into the Package tree, rename to remove the *tm suffix?

Thanks both for the reply.
/tom

0 Likes

#4

Parts of Textmate bundles, such as snippets and grammars, are compatible with ST2. You shouldn’t need to do any renaming—cloning it into Packages should be good enough.

0 Likes

#5

@adzenith: Stunning! Saved me an hour today already.

Appreciate the link. Don’t know how I missed this one – I’ve been looking hard for something like this to build on/from.

Have a loonng book to edit and I’ll be using AsciiDoc + Sublime/2 all day, every day for the next month or so.

This is an good starting point – I’ll futz with the directory layout a bit, tweak up some of the tabTriggers, and post back when I have something on GitHub to share.

/tom

0 Likes