Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

One way to use Home and End to jump to line start/end Apps
I wanted to find a way to use the Home and End keys to go to the beginning and end of a line, as I find that more convenient than using Command-Left Arrow and Command-Right Arrow. Here's how I solved it...

First, install Butler, then create two new "Keystroke" Smart Items -- click the Plus sign, then select Smart Items » Keystrokes from the pop-up menu. Set the first to map Home to Command-Left Arrow, and the second to Command-Right Arrow.

[robg adds: You could use any keyboard macro tool to do this; Butler is probably overkill if you just want to set up these two simple macros. And obviously, you can extend this to reassign any keyboard key to a functionality you prefer, as long as it has an existing OS X keystroke.]
    •    
  • Currently 2.04 / 5
  You rated: 2 / 5 (23 votes cast)
 
[8,939 views]  

One way to use Home and End to jump to line start/end | 7 comments | Create New Account
Click here to return to the 'One way to use Home and End to jump to line start/end' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
One way to use Home and End to jump to line start/end
Authored by: wallybear on Nov 25, '09 08:02:27AM

You can also use Spark, it's slimmer than Butler.



[ Reply to This | # ]
One way to use Home and End to jump to line start/end
Authored by: bhas on Nov 25, '09 08:02:57AM

Another way is to make a ~/Library/KeyBindings/DefaultKeyBindings.dict containing

{
/* home Shift+home*/
"\UF729" = "moveToBeginningOfLine:";
"$\UF729" = "moveToBeginningOfLineAndModifySelection:";

/* end Shift+end*/
"\UF72B" = "moveToEndOfLine:";
"$\UF72B" = "moveToEndOfLineAndModifySelection:";
}

These keybindings will work in all Cocoa applications (and can get you into trouble with some applications which don't like these redefinitions; it seems that Numbers is one of them).

More information can be found at Jacob Rus' pages: http://www.hcs.harvard.edu/~jrus/site/cocoa-text.html

I have also mapped PgUp and PgDn to move the caret/insertion point in order to keep the current line onscreen.

You can do lots more with the keybindings.dict



[ Reply to This | # ]
One way to use Home and End to jump to line start/end
Authored by: chris_on_hints on Nov 25, '09 01:18:30PM
This has been the best way to do it for many years. Shame apple hasnt sorted this out yet: Link to the forums

[ Reply to This | # ]
One way to use Home and End to jump to line start/end
Authored by: chris_on_hints on Nov 25, '09 01:20:20PM

...oh and also map home to Ctrl-A and end to Ctrl-E specifically for the terminal app and you have it working there too. Butler is able to set the keystrokes on a per-app basis.



[ Reply to This | # ]
One way to use Home and End to jump to line start/end
Authored by: cnf on Nov 25, '09 02:28:13PM

Nothing to sort out, it has always been as it is now on a mac. I, and many other mac users, prefer it as is, thank you.



[ Reply to This | # ]
One way to use Home and End to jump to line start/end
Authored by: interlard on Nov 25, '09 02:39:55PM

I'd just like to point out that I'm a long-time Mac user and have no need for the default home/end key actions: jump to the beginning of the document, but leave the cursor where it was. It just makes no sense to me.

I use KeyRemap4MacBook to map these to start/end of line, which are much more common actions, in my opinion.



[ Reply to This | # ]
One way to use Home and End to jump to line start/end
Authored by: chris_on_hints on Nov 26, '09 01:11:51PM

Last time I was using a Mac desktop machine with an apple-supplied keyboard, the home and end keys did nothing. I remember thinking "hey apple, why give us a keyboard with dead keys??". That was on a G4 desktop with OSX 10.1, 10.2, 10.3 and 10.4.



[ Reply to This | # ]