I'm on OS X 10.8.4 using ST2. When I use the Home and End keys, the viewport moves and the cursor is left alone. This is standard Mac behavior, and what I'd expect.
However, when I use Page Up (pageup/pgup) and Page Down (pagedown/pgdn), the cursor moves along with the viewport. This is not how other Mac apps behave, and I'd like the cursor to be left alone for these keys too.
I've been able to get this half-working by adding this to my key bindings:
[
{ "keys": ["pageup"], "command": "scroll_lines", "args" : {"amount": 30.0} },
{ "keys": ["pagedown"], "command": "scroll_lines", "args" : {"amount": -30.0} }
]
However, the amounts there are hard-coded. It looks like viewport_extent will get me the height of the viewport, but how can I use that from within the key bindings file? Is this even the correct solution for this? I feel like it's an awful lot of work to go to to get this behavior.
Thanks in advance.
Just using Fn+up
to pageup and Fn+down
to pagedown.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With