TextWrangler: hotkeys to move line up/down

For Mac OS X it is ctrl+↑ or ctrl+↓.

You may need to change the Mission Control hotkey settings (in System Preferences) as the two keyboard strokes are preset there.


There's nothing mentioned in the manual (only Exchange characters and Exchange words).


If TextWrangler supports the Cocoa Text System (which I suspect it doesn't, but still) you can create the file ~/Library/Keybindings/DefaultKeyBinding.dict and enter the following:

{
    "~\UF701" = (
        "moveToBeginningOfLine:",
        "deleteToEndOfLine:",
        "deleteForward:",
        "moveDown:",
        "yank:",
        "insertNewline:",
        "moveUp:"
    );
}

This will add the shortcut Opt-DownArrow for a line-swap command (with the line below) to every application supporting the Cocoa text system.


I do not think TextWrangler has this built in.

You can run applescripts in TextWrangler though, so you could make this work. I even found some applescripts that will do this.

You will need to replace BBEdit with TextWrangler in the applescripts. Put the scripts in "~/Library/Application Support/TextWrangler/Scripts/" and they will show up on the scripts menu in TextWrangler. Click Window -> Palettes -> Scripts to view the scripts palette, where you can set custom keyboard shortcuts.