Take the 2-minute tour ×

Trying out TextWrangler since my TextMate trial is about to expire and I'm not sure it's worth the cash to keep using it. The main thing I'm missing is the ability to cut the entire line that the cursor is on without having to select it (which I could accomplish through a TextMate macro). Yeah, I can hit ⌘L ⌘X, but I'd like to map this sequence to ^X so I can do it purely with my left hand. Seems like this should be easy, but it's beyond me. What's the best way to get this functionality?

share|improve this question
Why not use the Emacs bindings checkbox? –  user3463 Feb 10 '11 at 22:58
@Randolph: to the best of my knowledge (correct me if I'm wrong), there is no cut line command in Emacs, only the cut-to-end command. –  Ian Henry Feb 11 '11 at 1:19

2 Answers 2

up vote 1 down vote accepted

This is the solution I came up with. I created the following script:

tell application "TextWrangler"
    tell window 1
        select line the (startLine of the selection)
        set the clipboard to (contents of the selection) as text
        delete the selection
    end tell
end tell

And bound it to ^X in Window > Palettes > Scripts. I've never used AppleScript before, so there might be a better/cleaner way to do this, but this seems to work fine.

share|improve this answer
Well that's thinking outside the box. I'm giving you my vote. Now accept your own answer to close the question :-) –  user3463 Feb 11 '11 at 5:32
Will as soon as I can -- apparently you have to wait 48 hours before you can accept your own answer, which was news to me. Could be because my SU account has no rep, I guess. –  Ian Henry Feb 12 '11 at 2:46

I don't know if this is possible with TextWrangler. The method I use is to go to preferences and turn on single click line selection. With this you click once to the left of the line and just delete the line like normal.

share|improve this answer

Your Answer


