[TextMate] Re: Working with selections and macros/commands?

bongoman infolists at gmail.com
Sun Oct 10 03:07:21 UTC 2004


Me again.

Now I'm trying to create a command to comment out a single line thus:
// commented line

I'm not a shell scripter but am trying this:

set oldLine = $TM_CURRENT_LINE
set newLine = "// $oldLine"
echo -n "$newLine"

But no go. What I want to achieve is to comment out the current line,
not a selected line. So wherever the caret is when I invoke the
command gives me a commented single line.

So whether this script is OK or not I'm a little stuck on what my
input and output should be for such a command.

Any clues appreciated.

bongoman


On Sun, 10 Oct 2004 09:54:43 +1000, bongoman <infolists at gmail.com> wrote:
> Got it. It's a command. I now realise I can echo text back to replace
> selected text. Excellent.
> 
> bongoman
> 
> 
> 
> 
> On Sun, 10 Oct 2004 08:27:07 +1000, bongoman <infolists at gmail.com> wrote:
> > Hi there
> >
> > Am wanting to create a macro or snippet to allow me to comment out a
> > selection thus:
> >
> > /* commented selection */
> >
> > But am a little unclear if this is via a macro or a snippet. Either
> > way, I'm having trouble seting this up.
> >
> > Any clues appreciated...
> >
> > bongoman
> >
>



More information about the textmate mailing list