One thing I liked about vim was the continuation of the "*" down the same column for each line in a block comment. So something entered like: (* Hello! Blah
would be formated to: (* Hello! * Blah
I implemented this in the O'Caml language by changing the block comment language rule to: { name = 'comment.block.ocaml'; begin = '((*.*))?$'; end = '*)'; beginCaptures = { 1 = { name = 'comment.block.ocaml.begin'; }; }; },
And adding two snippets for the return key: One for the scope comment.block.ocaml.begin that would return, space in, and add a "* ". One for comment.block.ocaml that would only return and add a "* ".
Xefore I charge off and add this for C, is this the best way to implement this feature? Or am I missing an easier way? I've attached the two snippets and language syntax for O'Caml if anybody would like to try ti.
-- -Corey O'Connor
I simply made a snippet " * "
bound it to enter and set the scope to "comment.block". Might be too simple and one has to press enter, though enter is bound to such things for different languages like markdown to continue lists and such :) It might not work correctly with your indentation but it's the simplest thing without changing grammars.
Soryu
On 25.02.2006, at 11:28, Corey O'Connor wrote:
One thing I liked about vim was the continuation of the "*" down the same column for each line in a block comment.
I tried that at first, and it didn't align the * in the right column. Maybe I'm a bit demanding, but that's important to me :-) Plus, I don't mind if I don't get markdown's feature's in O'Caml ;-)
-Corey
On 2/25/06, Soryu Soryu@serenity.de wrote:
I simply made a snippet "
"
bound it to enter and set the scope to "comment.block". Might be too simple and one has to press enter, though enter is bound to such things for different languages like markdown to continue lists and such :) It might not work correctly with your indentation but it's the simplest thing without changing grammars.
Soryu
On 25.02.2006, at 11:28, Corey O'Connor wrote:
One thing I liked about vim was the continuation of the "*" down the same column for each line in a block comment.
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
-- -Corey O'Connor
I tried that at first, and it didn't align the * in the right column. Maybe I'm a bit demanding, but that's important to me :-) Plus, I don't mind if I don't get markdown's feature's in O'Caml ;-)
You could probably record a macro to do it too:
Return Space * space
I think I bound it to shift-return and scoped it to comment.block and it worked out just fine.
It was on another computer, so I don't have it in front of me atm, but I think that should do the trick.
-steve