Last active
February 4, 2023 16:06
-
-
Save jovianlin/ef74a5fc8cd247a807b6bdc71a5cbd2e to your computer and use it in GitHub Desktop.
~/.tmux.conf for iTerm2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
########################### | |
# ~/.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