+8

OSX: up and down on first and last line

adzenith 14 years ago updated by Pavlos Vinieratos 13 years ago 6
In OS X, pressing up on the first line of a buffer should go to the beginning of the line, and pressing down on the last line should go to the end.
I disagree. This is TextEdit's behaviour, but not that of vi or emacs. What ST does right now seems correct.
TextMate is also doing this. It's also convenient not having to use another key combo at this point.
It's not just TextEdit but every text box in OSX that has this behavior. As such it's a little strange when it doesn't work in Sublime Text.
Thanks for pointing this out. I suppose it's a matter of taste. My personal preference is to keep the prev_line/next_line commands orthogonal to the goto_beggining_of_line commands (not sure what they are actually called). One reason I prefer this behavior is that otherwise, the action of prev_line is not reversible with next_line if you reach the beginning of the file. For up arrow/down arrow, which will be used frequently in basic code viewing, I think having prev_line and next_line always be inverse operations adheres to the "principle of least surprise".
I'd also like to see this feature, or at least a config option for it.

If I put the marker in the middle of the next to last line, hold shift and press down, it'll select up until that point on the next line. If I press down again, it'll now select to the end of the line.

But if I put the marker in the middle of the last line and press shift+down nothing happens.

I often want to select the whole first or last line by holding shift and pressing up/down so it's quite annoying when this doesn't work. I tried looking in the plugin API if I could implement this myself, but it doesn't seem possible.

And while I'm at it, great editor. I've been using it for a while and just bought a license to show my support :)
can't we at least have a way of changing the behavior with keybindings?

something like:
{ "keys": ["up"], "command": "move", "args": {"by": "characters", "forward": false }, "context": 
    [ 
{ "key": "something", "operator": "something", "operand": "something" } 
    ] }
?
I cannot find the right context.