Killing a fly with a cannon:
Go to Preferences... > Profiles > Keys (not Preferences... > Keys)
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 ...
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
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
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 ...
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.
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
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 ...
In iTerm go to Preferences -> General and under Startup set Use System Window Restoration Setting.
Go to macOS System Preferences -> General and make sure that Close windows when quitting an app is unchecked.
⌘+⌥+←/↑/→/↓ 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
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 ...
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....
You have to set the scroll back buffer. This option is found under Profiles >> Terminal.
You can either set the number of lines in the buffer to the number of lines you want to scroll back, or check the box for "unlimited scrollback".
Open iTerm2 preferences by using the keyboard shortcut, Command + , or by invoking the command iTerm2 → Preferences... in the Menu bar.
In the Preferences window, switch to Profiles tab and under Working Directory select Advanced Configuration. (The default selection is Home directory.)
Now, click on the Edit... button, and in the pane that opens, under ...
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'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.
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"'
You have to update your TERMINFO file.
Thanks to wincent's video and his github pages
Watch the video and look at his github pages, they're excellent.
I have the following note stored on my HD:
We can have italics in the terminal.
This works in iTerm as well as Terminal.
We have to adapt the terminfo database to tell it to display italics.
Create a ...
There's a pretty exhaustive description of editing the bash prompt here there might be some linux specific stuff, but most of it is generic bash stuff.
But just for getting started, I recommend this bash profile generator
It is pretty simple, so I've since learned more and my prompt looks like:
[[ -s "/Users/dwightk/.rvm/scripts/rvm" ]] && ...
See the answers from this U&L Q&A titled:
List all commands that a shell knows
My personal favorite is to utilize compgen since this is part of the family of tools used to build all the tab completion when you're in a terminal and hit tab> + tab twice.
$ compgen -c
$ compgen -c | tail