Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

When editing texts, left and right arrow keys are frequently used. But it takes quite some time to move your right hand from the letters section to the arrow keys.

I used to use a Sony laptop, on which I could press "fn" with my left hand and then press "u" and "o" with my right hand to achieve the functions of "left arrow key" and "right arrow key", so my right hand seldom moved away from "jkl;". Neat.

Is there a similar resort on Mac?

Thanks!!

share|improve this question
    
Use emacs or vi their arrow keys use ctrl and a letter - and many other editors allow emulation of these –  Mark May 15 at 13:23
    
Oh I meant a universal method, not confined to an app, say the textbox where I'm typing right now :] but thanks! –  user78236 May 15 at 13:53

7 Answers 7

up vote 3 down vote accepted

You can use BetterTouchTool http://www.boastr.de to globally assign keyboard shortcuts. However You can't assign fn key.

enter image description here

share|improve this answer
    
Wow! This app is awesome! I assigned cmd+j and cmd+k for left and right arrow keys, so cursor navigation is now faster! Thanks a lot Mateusz :] –  user78236 May 15 at 17:58

You can use this :

  • ctrl+A: beginning of line.

  • ctrl+E: end of line.

  • ctrl+U: delete from cursor to beginning of line.

  • ctrl+K: delete from cursor to end of line.

  • ctrl+W: erase word to the left.

  • ctrl+T: transpose characters around cursor.

share|improve this answer
    
Not all apps support these e.g. Firefox - I agree that any good app written to Apple's interface guide should –  Mark May 15 at 13:58
1  
@Mark it works with cocoa applications –  Thomas May 15 at 13:59
    
And most shells. –  Max Ried May 15 at 15:33
    
In cocoa Alt-Left, Alt-Right, Apple-Left, Apple-Right also does useful actions. But yes, this all is no about OPs question at all –  Max Ried May 15 at 15:35

ctrl+B and ctrl+F are the same as left and right arrow in cocoa apps.

share|improve this answer

You can map menu entries to keyboard shortcuts.

So if your favourite editor has something prepared, then you can do this.

Go to System Preferences > Keyboard > Shortcuts, and add go to the entry App Shortcuts.

So i think it depends on your favourite editor. When you can jump there from word to word, its even cooler then to just move the cursor.

I can recommend Sublime Text 2/3 for this.

share|improve this answer
2  
Thanks! But what I meant was a universal key combination which can achieve exactly the function of arrow keys, say "fn+u" does what "left arrow" does, and "fn+o", right arrow. That'd be cool:) –  user78236 May 15 at 14:05
    
I know, but so far this is the closest you can get. –  2DD8847 May 15 at 14:12

I use KeyRemap4MacBook on my unibody mid-2010 MacBook, which I think was the first series built after they stopped including the numpad mode. The site says the software works for all Macs, so you could probably use it to create a mapping that works for you.

share|improve this answer
    
Didn't try this, but thanks! I'm using BetterTouchTool recommended by @mateusz, which is very good :] –  user78236 May 15 at 18:01

You could use a text editor that supports vi mode.

vi is a unix text editor that is controlled without a mouse and therefore has very capable keyboard shortcuts, not just to move around whithin a text, but also to quickly edit text.

Many modern text editors that are geared towards programmers have implemented a "vi mode," which means you can turn on all those powerful shortcuts. I learned how to use vi mode when programming, but I have come to absolutely love it in any kind of text editing. It takes quite a while to really be comfortable with all of the shortcuts, but once you are, your productivity skyrockets!

Here are just a few of the powerful keyboard shortcuts that vi mode provides:

  • jump to the end/beginning of a word
  • jump to the en/beginning of a line
  • jump to a certain character
  • delete the current word
  • go to the beginning/end of the document

My favorite editor that has vi mode is Sublime Text 3. You can evaluate the full version for as long as you like. To enable vi mode follow this link: enabling vi mode

Here are a couple of interactive tutorials that teach you vi shortcuts:

share|improve this answer

Many OS X text views support a few Emacs style shortcuts like:

  • control-p moves up
  • control-n moves down
  • control-b moves left
  • control-f moves right

To see a full list of the shortcuts, run plutil -convert xml1 /System/Library/Frameworks/AppKit.framework/Resources/StandardKeyBinding.dict -o -|pl|grep -v noop:|ruby -pe '$_.gsub!(/[^ -~\n]/){"\\U%04x"%$&.ord}'.

You can use KeyRemap4MacBook to make the Emacs style shortcuts work in more places:

<?xml version="1.0"?>
<root>
  <appdef>
    <appname>EMACSMODEIGNORE</appname>
    <equal>com.googlecode.iterm2</equal>
    <equal>org.gnu.Emacs</equal>
    <equal>com.apple.Terminal</equal>
    <equal>com.vmware.fusion</equal>
  </appdef>
  <item>
    <identifier>emacs</identifier>
    <name>emacs</name>
    <not>EMACSMODEIGNORE</not>
    <autogen>__KeyToKey__ KeyCode::P, VK_CONTROL | ModifierFlag::NONE, KeyCode::CURSOR_UP</autogen>
    <autogen>__KeyToKey__ KeyCode::N, VK_CONTROL | ModifierFlag::NONE, KeyCode::CURSOR_DOWN</autogen>
    <autogen>__KeyToKey__ KeyCode::B, VK_CONTROL | ModifierFlag::NONE, KeyCode::CURSOR_LEFT</autogen>
    <autogen>__KeyToKey__ KeyCode::F, VK_CONTROL | ModifierFlag::NONE, KeyCode::CURSOR_RIGHT</autogen>
    <autogen>__KeyToKey__ KeyCode::P, VK_CONTROL | VK_SHIFT | ModifierFlag::NONE, KeyCode::CURSOR_UP, VK_SHIFT</autogen>
    <autogen>__KeyToKey__ KeyCode::N, VK_CONTROL | VK_SHIFT | ModifierFlag::NONE, KeyCode::CURSOR_DOWN, VK_SHIFT</autogen>
    <autogen>__KeyToKey__ KeyCode::B, VK_CONTROL | VK_SHIFT | ModifierFlag::NONE, KeyCode::CURSOR_LEFT, VK_SHIFT</autogen>
    <autogen>__KeyToKey__ KeyCode::F, VK_CONTROL | VK_SHIFT | ModifierFlag::NONE, KeyCode::CURSOR_RIGHT, VK_SHIFT</autogen>
    <autogen>__KeyToKey__ KeyCode::B, VK_OPTION | ModifierFlag::NONE, KeyCode::CURSOR_LEFT, VK_OPTION</autogen>
    <autogen>__KeyToKey__ KeyCode::F, VK_OPTION | ModifierFlag::NONE, KeyCode::CURSOR_RIGHT, VK_OPTION</autogen>
    <autogen>__KeyToKey__ KeyCode::B, VK_OPTION | VK_SHIFT | ModifierFlag::NONE, KeyCode::CURSOR_LEFT, VK_OPTION | VK_SHIFT</autogen>
    <autogen>__KeyToKey__ KeyCode::F, VK_OPTION | VK_SHIFT | ModifierFlag::NONE, KeyCode::CURSOR_RIGHT, VK_OPTION | VK_SHIFT</autogen>
    <autogen>__KeyToKey__ KeyCode::I, VK_CONTROL | ModifierFlag::NONE, KeyCode::TAB</autogen>
    <autogen>__KeyToKey__ KeyCode::D, VK_OPTION | ModifierFlag::NONE, KeyCode::FORWARD_DELETE, VK_OPTION</autogen>
  </item>
</root>

This would map fn-U to the left arrow key:

<autogen>__KeyToKey__ KeyCode::U, ModifierFlag::FN, KeyCode::CURSOR_LEFT</autogen>

See https://pqrs.org/macosx/keyremap4macbook/xml.html.en or http://osxnotes.net/keyremap4macbook.html for more information.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.