Skip to content

Instantly share code, notes, and snippets.

@ariel-frischer
Forked from jovianlin/.tmux.conf
Created February 1, 2022 02:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ariel-frischer/b60c6fe0ee11b0ff934760ebe69b233a to your computer and use it in GitHub Desktop.
Save ariel-frischer/b60c6fe0ee11b0ff934760ebe69b233a to your computer and use it in GitHub Desktop.
~/.tmux.conf for iTerm2
###########################
# ~/.tmux.conf for iTerm2 #
# #
# by Jovian Lin #
###########################
##########
# Basics #
##########
# Initial setup
set -g default-terminal xterm-256color
set -g status-keys vi
# remap prefix from 'C-b' to 'C-a'
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
# split panes using | and -
bind \ split-window -h
bind - split-window -v
unbind '"'
unbind %
# reload config file (change file location to your the tmux.conf you want to use)
bind-key r source-file ~/.tmux.conf \; display-message "tmux.conf reloaded."
# Easy clear history
bind-key l clear-history \; display-message "clear-history"
##############
# Navigation #
##############
# Use Alt-arrow keys without prefix key to switch panes
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D
# Use Alt-Shift-arrow
bind -n M-S-Left resize-p -L 2
bind -n M-S-Right resize-p -R 2
bind -n M-S-Up resize-p -U 2
bind -n M-S-Down resize-p -D 2
# Allow the arrow key to be used immediately after changing windows.
set-option -g repeat-time 0
# Shift-arrow to switch windows
bind -n S-Left previous-window
bind -n S-Right next-window
# Enable Mouse Support
# More: http://www.rushiagr.com/blog/2016/06/16/everything-you-need-to-know-about-tmux-copy-pasting/
set -g mouse on
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment