Home Download Buy Blog Forum Support

Introducing a New Comment Marker

Introducing a New Comment Marker

Postby tsyroid on Sun Jul 31, 2011 9:26 pm

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
tsyroid
 
Posts: 15
Joined: Sun Jan 30, 2011 3:02 am

Re: Introducing a New Comment Marker

Postby adzenith on Mon Aug 01, 2011 3:42 am

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?
adzenith
 
Posts: 1213
Joined: Mon Oct 19, 2009 9:12 pm

Re: Introducing a New Comment Marker

Postby tsyroid on Mon Aug 01, 2011 8:50 pm

@adzenith: workflow as follows,

some text in the file
some more text

// add comment to first line <cr>
(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
tsyroid
 
Posts: 15
Joined: Sun Jan 30, 2011 3:02 am

Re: Introducing a New Comment Marker

Postby adzenith on Mon Aug 01, 2011 11:14 pm

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.
adzenith
 
Posts: 1213
Joined: Mon Oct 19, 2009 9:12 pm

Re: Introducing a New Comment Marker

Postby tsyroid on Wed Aug 03, 2011 5:14 am

@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
tsyroid
 
Posts: 15
Joined: Sun Jan 30, 2011 3:02 am


Return to Technical Support

Who is online

Users browsing this forum: No registered users and 17 guests