Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

In Linux while editing text, I can move block up and down with ctr+up arrow, ctr+down arrow.

What is the OSX equivalent?

share|improve this question

1 Answer 1

I don't know what control+up does on other platforms, but if you (or other people searching for this question) mean scrolling a page up or down and moving the caret, you can use option+page up and option+page down. They don't work in web views or iWork applications though.

In TextMate you can make page up and page down move the caret by copying /Applications/TextMate.app/Contents/Resources/KeyBindings.dict to ~/Library/Application Support/TextMate/KeyBindings.dict and adding this:

"\UF72C" = pageUp:;
"\UF72D" = pageDown:;

If you mean moving the caret multiple lines up or down, you can create ~/Library/KeyBindings/ and save a property list like this as DefaultKeyBinding.dict:

{   
    "^\UF700" = (moveUp:, moveUp:, moveUp:, moveUp:, moveUp:, moveUp:);
    "^\UF701" = (moveDown:, moveDown:, moveDown:, moveDown:, moveDown:, moveDown:);
    "^$\UF700" = (moveUpAndModifySelection:, moveUpAndModifySelection:, moveUpAndModifySelection:, moveUpAndModifySelection:, moveUpAndModifySelection:, moveUpAndModifySelection:);
    "^$\UF701" = (moveDownAndModifySelection:, moveDownAndModifySelection:, moveDownAndModifySelection:, moveDownAndModifySelection:, moveDownAndModifySelection:, moveDownAndModifySelection:);
}

Or if you mean swapping the selected lines with the line above or below:

"^\UF700" = (selectParagraph:, setMark:, deleteToMark:, moveBackward:, moveToBeginningOfParagraph:, setMark:, yank:, moveBackward:, selectToMark:);
"^\UF701" = (selectParagraph:, setMark:, deleteToMark:, moveToEndOfParagraph:, moveForward:, setMark:, yank:, moveBackward:, selectToMark:);    

See http://www.hcs.harvard.edu/~jrus/site/cocoa-text.html and http://lri.me/keybindings.html.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.