Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> Someone who knows readline better than me can tell you how to move between words.

It's alt+leftArrow and alt+rightArrow.

Other useful ones which work in native text boxes:

    cmd+leftArrow and cmd+rightArrow to move to the start and end of lines in text boxes
    cmd+upArrow and cmd+downArrow to move to the very top and very bottom
    ctrl+a and ctrl+e to move to the start and end of paragraphs
    shift+ any of the above to move the current selection
    alt+backspace and cmd+backspace to delete the previous word or to the start of the line
There are more emacs-like keyboard shortcuts in the native text boxes, like ctrl+t to transpose letters, but I don't really use them that much.

Ctrl+backspace to delete the previous word in Windows always catches me out, since it works some of the time, but other times is just inserts a control character which I then also have to delete...



> Ctrl+backspace to delete the previous word in Windows always catches me out, since it works some of the time, but other times is just inserts a control character which I then also have to delete...

This is the single thing that prevents me from using Windows.

I dual boot with Windows on my iMac and I love the general appearance of Windows 7, much more than OS X. I feel like I can just get stuff done.

But then I try to work, and things just fail... A lack of common UI controls (Cocoa, OS X's killer feature) drives me insane when ctrl+a won't work, or a text field won't spell check for me, or I can't right click a word and get the definition of the word.

I find this is my problem with the iPhone as well. I got the iPhone 4 and 4S when they first came out as they are my best option out there, but I hate them so much. Other platforms are doing much more interesting things, such as Windows Phone 7's fresh interface, or the power of Android. However, all of these platforms lack the high level of polish and vibrant ecosystems the iPhone has.


alt+left or alt+right doesn't work for me in Terminal out of the box (I usually use iTerm2 where it doesn't work either) - do you need to change any settings (such as emulation, terminal type etc) to get at that?


Ah, my bad, I must have set that up myself.

According to this[1] stack overflow post, the vim key bindings for move back and forward work by default (which is news to me), or you can set up the alt left and right behaviour by following the instructions here[2].

[1] http://stackoverflow.com/questions/81272/is-there-any-way-in...

[2] http://blog.macromates.com/2006/word-movement-in-terminal/


1) Go to the Terminal menu > Settings, click the Settings pane.

2) Select your preferred theme (left). It's probably the one listed as "default."

3) Click the Keyboard tab.

4) Click the "+" button to add a new Key to Action mapping.

• Key: cursor left

• Modifier: option

• Action: send string to shell:

• In the blank blank space: \033b

  Note: This is the ESC key followed by a lowecase “b“.
• Click OK.

5) Click the "+" button to add a new Key to Action mapping.

• Key: cursor right

• Modifier: option

• Action: send string to shell:

• In the blank blank space: \033f

  Note: This is the ESC key followed by a lowercase “f“.
• Click OK.


Or just click the "option as meta" checkbox!


Thanks. Interestingly enough in iTerm2 this option is worded as "Left/Right option key acts as +Esc" rather than "Meta"


It works for me right out of the box on a brand new Lion install. No settings have been changed yet.


Didn't realize that "alt" here meant the "esc" key.


I am talking about the "alt/option" key on the keyboard. No "esc".




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: