Home Download Buy Blog Forum Support

Dedicated End key (Mac) not working

Dedicated End key (Mac) not working

Postby fffjfjj on Tue Mar 06, 2012 4:29 pm

Hello,

I'm using an official Mac keyboard with numeric keypad (this product => http://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...
fffjfjj
 
Posts: 3
Joined: Tue Mar 06, 2012 3:44 pm

Re: Dedicated End key (Mac) not working

Postby fizzicist on Tue Mar 06, 2012 5:14 pm

fffjfjj wrote:Hello,

I'm using an official Mac keyboard with numeric keypad (this product => http://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...


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:

Code: Select all
{ "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.
fizzicist
 
Posts: 4
Joined: Thu Aug 11, 2011 3:53 am

Re: Dedicated End key (Mac) not working

Postby hibbelig on Tue Mar 06, 2012 11:03 pm

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...
hibbelig
 
Posts: 77
Joined: Wed Dec 21, 2011 11:24 pm

Re: Dedicated End key (Mac) not working

Postby fffjfjj on Wed Mar 07, 2012 10:12 am

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

Code: Select all
{ "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.
fffjfjj
 
Posts: 3
Joined: Tue Mar 06, 2012 3:44 pm

Re: Dedicated End key (Mac) not working

Postby jps on Wed Mar 07, 2012 10:24 am

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.
jps
Site Admin
 
Posts: 3071
Joined: Wed Mar 19, 2008 12:33 pm

Re: Dedicated End key (Mac) not working

Postby fffjfjj on Wed Mar 07, 2012 4:01 pm

@jps Didn't know that... There's any official article, document or reference about that?
fffjfjj
 
Posts: 3
Joined: Tue Mar 06, 2012 3:44 pm

Re: Dedicated End key (Mac) not working

Postby jps on Wed Mar 07, 2012 11:59 pm

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.
jps
Site Admin
 
Posts: 3071
Joined: Wed Mar 19, 2008 12:33 pm

Re: Dedicated End key (Mac) not working

Postby larksmann on Mon Jul 23, 2012 6:47 pm

@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?
larksmann
 
Posts: 2
Joined: Mon Jul 23, 2012 6:43 pm

Re: Dedicated End key (Mac) not working

Postby hsarret on Fri Aug 03, 2012 1:02 pm

{ "keys": ["shift+end"], "command": "move_to", "args": { "to": "eol", "extend": true } },
{ "keys": ["shift+home"], "command": "move_to", "args": { "to": "bol", "extend": true } },
hsarret
 
Posts: 4
Joined: Fri Aug 03, 2012 1:00 pm

Re: Dedicated End key (Mac) not working

Postby larksmann on Fri Aug 03, 2012 5:34 pm

hsarret wrote:{ "keys": ["shift+end"], "command": "move_to", "args": { "to": "eol", "extend": true } },
{ "keys": ["shift+home"], "command": "move_to", "args": { "to": "bol", "extend": true } },


Thanks hsarret! Works perfectly.
larksmann
 
Posts: 2
Joined: Mon Jul 23, 2012 6:43 pm

Next

Return to Technical Support

Who is online

Users browsing this forum: blurk, Exabot [Bot], Google [Bot] and 20 guests