Have you ever tried to use "Command + back arrow", "Option + front arrow" and such text navigation commands on iTerm? If you did, you've noticed that it simply won't work out of the box and searching for that on Google turns up to be a big mess with confounding results.
There are lots of information in many blog posts, stackoverflow posts and old blog comments (2007), but no centralized solution.
So, here's a centralized solution :D
How to fix
- Open up your iTerm;
- Click on "iTerm > Preferences";
- Go to "Profiles";
- Choose your default profile (it may be called "Default" if you didn't changed anything);
- Go to "Keys" (inside the Profile tab);
- On "Left option key act as:" click the "+Esc" box.
- Below the "Profile Shortcut Keys" grid, click on "+" button and add:
COMMAND + <-
COMMAND + ->
OPTION + <-
OPTION + ->
OPTION + Delete
ESC+ "0x1b 0x7f"
BONUS! Word delete backslash
After getting proud of myself for making my iTerm work as expected, I've tried to delete the last word of a line like this:
$ cat /var/log/nginx.log
And BAM! It deleted the whole path. So... Here's a way to fix that too.
Add this line to your .bashrc file:
Some background information...
I wrote that tutorial after doing a clean-install of Mavericks on my MacOSX and forgotten to backup my iTerm2 configs. Shame on me!
Kids, never forgets to backup your iTerm configs :)