- Window theme: Preferences > Appearance Tab > Theme > Light/Dark
- Show folder icon on window title: Preferences > Appearance Tab > Window: Show proxy icon in window title bar
- Background transparancy and blur: Preferences > Profiles Tab > Window Tab > Transparency (a third) & Blur (Checked, full)
- Color theme: Preferences > Profiles Tab > Colors Tab > Color Presets...
Add the following to ~/.bashrc
.
Change tab and window title to current directory name:
# iTerm2 tab and window title
if [ $ITERM_SESSION_ID ]; then
# Set tab title to current directory
# the $PROMPT_COMMAND environment variable is executed every time a command is run
export PROMPT_COMMAND='echo -ne "\033]1;${PWD##*/}\007""; ':"$PROMPT_COMMAND";
fi
Or change tab title to current directory name, but window title to full path:
# iTerm2 tab and window title
if [ $ITERM_SESSION_ID ]; then
# Set tab title to current directory and set window title to full path
# the $PROMPT_COMMAND environment variable is executed every time a command is run
export PROMPT_COMMAND='echo -ne "\033]1;${PWD##*/}\007" && echo -ne "\033]2;${PWD}\007"; ':"$PROMPT_COMMAND";
fi
For SSH, change window title to username@host:
export PROMPT_COMMAND="echo -ne '\033]0;${USER}@${HOSTNAME}\007';$PROMPT_COMMAND"
Add the following to ~/.vimrc
.
Set tab title to buffer name:
if $TERM_PROGRAM =~ "iTerm"
" Set the title of the Terminal to the currently open file
function! SetTerminalTitle()
let titleString = expand('%:t')
if len(titleString) > 0
let &titlestring = expand('%:t')
" this is the format iTerm2 expects when setting the window title
let args = "\033]1;".&titlestring."\007"
let cmd = 'silent !echo -e "'.args.'"'
execute cmd
redraw!
endif
endfunction
autocmd BufEnter * call SetTerminalTitle()
endif
Change cursor shape according to mode:
let &t_SI = "\<Esc>]50;CursorShape=1\x7" " Vertical bar in insert mode
let &t_EI = "\<Esc>]50;CursorShape=0\x7" " Block in normal mode
let &t_SR = "\<esc>]50;CursorShape=2\x7" " Underline in replace mode
- Set option key as meta (alt): Preferences > Profile Tab > Keys Tab > Left β₯ Key & Right β₯ Key to Esc+
- Split panes (vertical or horizontal) shortcut: Preferences > Keys Tab > To switch split panes > β₯ Number
- βT: Open new tab.
- βD: Open new vertical split.
- β§βD: Open new horizontal split.
- β Number: Switch to window.
- β₯ Number: Switch to split pane.
- βC βV: Copy and paste commands.
- Force Touch on file names: trigger QuickLook π
Use tmux in iTerm2 interface and shortcuts, useful for SSH π
tmux -CC
Need additional install: iTerm2 > Install Shell Integration
Show image:
imgcat <image>