Killing a fly with a cannon:
Go to Preferences... > Profiles > Keys
Press Load Preset...
Select Natural Text Editing
Then, you can move a word backwards using Option ⌥ + ← and a word forwards using Option ⌥ + →, move to the start of the line using fn + ← and to the end of the line with fn + →. Also you can delete a word backwards using Option ⌥ + ⌫, delete ...
You can use iTerm2's system-wide hotkey with the Hotkey Window profile to do this.
In iTerm2 preferences, click on the "Keys" tab. In the bottom left, under "Hotkey", check "Show/hide iTerm2 with a system-wide hotkey" and assign the hotkey you'd like to use.
Check the "Hotkey toggles a dedicated window with profile:" option and choose "Hotkey Window" in ...
Go to iTerm Preferences → Profiles, select your profile, then the Keys tab. Find ⌥← and ⌥→ and set them to send escape sequence b and send escape sequence f respectively.
If you use ⌘→ and ←⌘ you will need to remap the next and previous tab shortcuts which are set to those as default. Terminal uses ⇧⌘→ and ⇧⌘← for these.
You can do this under Profiles, or ...
I like the following setup.
Preferences > Keys (or Preferences > Profiles > Keys)
Click the plus.
move forward one word
send escape sequence
move back one word
send escape sequence
delete to beginning of word (credit)
send hex code
delete to end of word
send escape sequence
You can Save and Restore Window Arrangement with ⇧ ⌘ S and ⇧ ⌘ R options under the Window screen in iTerm2
You can start the default Arrangement Option to enable are at Preferences -> General -> Startup -> Open default window arrangement .
You can add arrangements with the ⇧ ⌘ S and manage them under Preferences -> ...
Select "Reuse previous session's directory" from the preferences of your profile:
Alternatively click on "Advanced Configuration" then "Edit..." so you can set the working directory separately for new windows, new tabs & new split panes
There are several features listed on their features page.
Some of the features I like are:
Split pane view
Hotkey window for instant terminal anywhere
Search will highlight all found words (like in Chrome and Safari)
Instant replay (can "rewind" your session in case you forgot to note/copy something)
Growl support for ...
The easiest way to have iTerm2 open with a specific size, position and number of windows is:
Get it all set up the way you'd like to see it when it opens. Have all your iTerm2 windows sized and place where you like them.
From the top menu select Window -> Save Window Arrangement and give it a name
Go to the Preferences and under the Arrangements section ...
This looks like a change in tmux in 2.0 -> 2.1
setw -g mode-mouse on
set -g mouse-select-pane on
set -g mouse-resize-pane on
set -g mouse-select-window off
set-option -g mouse on
and everything seems ok
iTerm2 can set itself as the default SSH handler. In its preferences, go to “Profiles”. Create a profile to handle SSH sessions, or select an existing one. In the “General” section, bottom right, you can select which URL scheme this profile should handle:
Select SSH. iTerm2 will ask if it is to set itself up as the default SSH handler:
Confirm and you are ...
Ctrl-[ b jumps back a word. You can also use Esc instead or Ctrl-[, and f to go forward.
That is Ctrl+[ release and then b orf.
Or Esc and b or f.
More information can be found at this other discussion on AskDifferent.
Preferences are cached in 10.9. See http://hints.macworld.com/article.php?story=20130908042828630. If you edit a plist file directly or replace the plist of an application, the application will keep using the cached version even after you quit and reopen the application.
You can run defaults read com.googlecode.iterm2 or killall cfprefsd to apply the ...
@joel's answer is good, but Terminal.app gained some exclusive features in Lion:
support for Lion's restore feature
support for system services - this means I have a system shortcut for “new terminal in this folder” without strange hacks.
support for system services means great automator integration
document proxy in the window and generally better D&D ...
iTerm supports coloring of console output based on a set of regular expressions. You can set them up in Preferences > Profiles > Advanced > Triggers > Edit.
Here is my current set of regexes:
(?i:.*error.*) // Yellow on Black
(?i:.*(warning|warn).*) // Orange on Black
(?i:.*FATAL.*) // White on Red
To Get Forward (Alt-f), Backward (Alt-b) and Delete (Alt-d) Word
Go to iTerm > Preferences... > Profiles > Keys
Under Profile Shortcut Keys, click the + sign.
Type your key shortcut (option-b, option-f, option-d, option-left, etc.)
For Action, choose Send Escape Sequence.
Write b, d or f in the input field.
This works at least for bash. For zsh ...
This is a year old, but I'd like to add a response that isn't so heavy-handed. The accepted answer will open the previous directory every time you open a new tab, which I personally find frustrating. I feel it's easier to always open in the home directory and then open the current directory in a new tab as needed.
To do that, simply run the following ...
Okay, I found a solution...
Chris Johnsen has a good writeup of what causes this problem on github.
His tools work, but a better solution, if you have homebrew installed to:
brew install reattach-to-user-namespace
Then in your ~/.tmux.conf add these lines:
set-option -g default-command "reattach-to-user-namespace -l zsh" # or bash
bind C-c run "tmux ...
You'll want to override iTerm's default shortcuts with your own shortcuts to "Ignore".
Go to Preferences > Key and press the + button at the bottom of the Global Shortcut Keys:
Then add an entry for Cmd+K and choose "Ignore" for the action:
This disables Cmd+K.
⌘+⌥+←/↑/→/↓ will let you navigate split panes in the direction of the arrow, i.e. when using ⌘+D to split panes vertically, ⌘+⌥+← and ⌘+⌥+→ will let you switch between the panes.
Note: ⌥ is the [alt] key
If your default system shell is bash, your Terminal should start with it. You can check it on General tab under Terminal Preferences. Should look like the following:
If bash isn't your default shell, you can change it by typing:
chsh -s /bin/bash
To configure iTerm2 with zsh you have to open Preferences and change the command on General tab on your ...
You have to do two things:
set the LSCOLORS environment variable
create an alias for ls so that it shows colors by default
In your ~/.bash_profile add the following:
alias ls='ls -lGH' <-----This shows in list format, follow symlinks colorized
The the colors are set by each bit above; the first being ...
With the \033]0;TEXT\007 escape sequence.
Example of use in Bash: echo -ne "\033]0;$PWD\007"
Which you could add to your $PROMPT_COMMAND if you use Bash, or otherwise attach to you PS1 so it gets re-evaluated often.
Example: export PROMPT_COMMAND='echo -ne "\033]0;$PWD\007"'