Sublime Forum

Dedicated End key (Mac) not working

#1

Hello,

I’m using an official Mac keyboard with numeric keypad (this product => store.apple.com/us/product/MB110LL/B) and the dedicated “End” key does not take me to the end of the line, whereas “Cmd” + “Right Arrow” works fine.

I really like Sublime but without this key working, programming becomes slower…

0 Likes

#2

[quote=“fffjfjj”]Hello,

I’m using an official Mac keyboard with numeric keypad (this product => store.apple.com/us/product/MB110LL/B) and the dedicated “End” key does not take me to the end of the line, whereas “Cmd” + “Right Arrow” works fine.

I really like Sublime but without this key working, programming becomes slower…[/quote]

It looks like end executes “scroll_to_eof”. I put the following in my User Keymap (Preferences -> Key Bindings - User), and it made end execute Move To EOL:

{ "keys": "end"], "command": "move_to", "args": {"to": "eol"} }

I didn’t do a lot of testing to see if it had side effects. If you want to do this, you might want to keep an eye out for anything where scroll_to_eof might be needed, or make sure it is bound to some other alternate key.

0 Likes

#3

I think the behavior you are seeing is normal. Try hitting the key in TextEdit. ST strives to adhere to the UI conventions of the platform. I like that. Even if I don’t like a specific convention…

0 Likes

#4

@fizzicist That worked, thanks! I’ve also set the “Home” key to move to the beginning of the line:

{ "keys": "end"], "command": "move_to", "args": {"to": "eol"} }, { "keys": "home"], "command": "move_to", "args": {"to": "bol"} }

@hibbelig “End” key in TextEdit does nothing… And where does it says that “End” key convention of the Mac platform is “go to end of file” instead of “go to end of line”? Seems not natural to me.

0 Likes

#5

End scrolling to EOF is absolutely the OS X convention, it’s the default Cocoa key binding and it happens in all Cocoa apps by default.

0 Likes

#6

@jps Didn’t know that… There’s any official article, document or reference about that?

0 Likes

#7

A quick google will confirm this is something that many people switching from Windows or Linux to OS X encounter and find strange. You can rebind the key at the system level (see aforementioned google results), or just within Sublime Text, using its key binding system.

0 Likes

#8

@fizzicist and @fffjfjj, that works great!

However, shift+home and shift+end still select text from the cursor to BOF and EOF respectively. Any idea how to make it only select to BOL/EOL?

0 Likes

#9

{ “keys”: “shift+end”], “command”: “move_to”, “args”: { “to”: “eol”, “extend”: true } },
{ “keys”: “shift+home”], “command”: “move_to”, “args”: { “to”: “bol”, “extend”: true } },

0 Likes

#10

[quote=“hsarret”]{ “keys”: “shift+end”], “command”: “move_to”, “args”: { “to”: “eol”, “extend”: true } },
{ “keys”: “shift+home”], “command”: “move_to”, “args”: { “to”: “bol”, “extend”: true } },[/quote]

Thanks hsarret! Works perfectly.

0 Likes

#11

Hey folks,

Thank you SO much for this. I’m somewhat new to the Mac, so this is incredibly helpful for the time I have to spend in the text editor.

0 Likes

#12

A little off topic, but how do you move to the beginning/end of the file using ST commands?

0 Likes