Skip to content

Instantly share code, notes, and snippets.

@durrantm
Created July 27, 2020 11:31
Show Gist options
  • Save durrantm/56a5b4ed00b5ab0b75aed4b4f79ccb17 to your computer and use it in GitHub Desktop.
Save durrantm/56a5b4ed00b5ab0b75aed4b4f79ccb17 to your computer and use it in GitHub Desktop.
$ cat .tmux.conf
# mdd tmux settings
set -g history-limit 20000
bind r source-file ~/.tmux.conf \; display "Reloaded!" # Reload with ctrl-r
set -g prefix C-a # prefix from ctrl-b to ctrl-a
unbind C-b # allow ctrl-b for other things
set -sg escape-time 1 # quicker responses
bind C-a send-prefix # Pass on ctrl-a for other apps
set -g base-index 1 # Numbering of windows
set -g pane-base-index 1 # Numbering of panes
setw -g automatic-rename on
bind | split-window -h # Split panes horizontal
bind \ split-window -h -c '#{pane_current_path}' # Split panes horizontal
# bind - split-window -v -c '#{pane_current_path}' # Split panes vertically
bind h select-pane -L # Switch to Pane Left
bind j select-pane -D # Switch to Pane Down
bind k select-pane -U # Switch to Pane Up
bind l select-pane -R # Switch to Pane Right
bind -r C-h select-window -t :- # Quick Pane Selection
bind -r C-l select-window -t :+ # Quick Pane Selection
bind -r H resize-pane -L 5 # Switch to Pane Left
bind -r J resize-pane -D 5 # Switch to Pane Down
bind -r K resize-pane -U 5 # Switch to Pane Up
bind -r L resize-pane -R 5 # Switch to Pane Right
set-option -g mouse on
set -g default-terminal "screen-256color"
setw -g monitor-activity on # Activity Alerts
set -g visual-activity on
set -g status-fg white # Status line Colors
set -g status-bg black
#set-option -g status-bg colour235 #base02
set-option -g status-fg yellow # left side.
setw -g window-status-style fg=cyan # Window list color
setw -ga window-status-style bg=default
setw -ga window-status-style dim
setw -g window-status-current-style fg=white # Active Window Color
setw -ga window-status-current-style bg=black
setw -ga window-status-current-style bright
set -g pane-border-style fg=green # Pane colors
set -g pane-border-style bg=black
set -g pane-active-border-style fg=white
set -g pane-active-border-style bg=yellow
set -g message-style fg=white # Command/Message Line.
set -ga message-style bg=black
set -ga message-style bright
set-window-option -g window-status-current-style bg=black # e.g. 1:vi* colors
set-window-option -ga window-status-current-style fg=yellow # e.g. 1:vi* colors
set-window-option -ga window-status-current-style dim # e.g. 1:vi* colors
set -g status-right " "
set -g status-interval 6 # frequency of status line updates
set -g status-justify centre # center window list
setw -g mode-keys vi # vi keys to move
unbind v # Open panes in same directory as tmux-panes script
unbind n
bind v send-keys " ~/tmux-panes -h" C-m
bind n send-keys " ~/tmux-panes -v" C-m
unbind Up # Maximizing and Minimizing...
bind Up new-window -d -n tmp \; swap-pane -s tmp.1 \; select-window -t tmp
unbind Down
bind Down last-window \; swap-pane -s tmp.1 \; kill-window -t tmp
bind P pipe-pane -o "cat >>~/#W.log" \; display "Toggled logging to ~/#W.log"
# Make keys for copy mode be like vi
unbind [
bind Escape copy-mode
unbind p
bind p paste-buffer
# bind -t vi-copy 'v' begin-selection
# bind -t vi-copy 'y' copy-selection
# copy & paste between tmux and x clipboard
bind C-p run-shell "tmux set-buffer \"$(xclip -o)\"; tmux paste-buffer"
bind C-y run-shell "tmux show-buffer | xclip -sel clip -i"
# Following 2 give error when tmux is first applied on unix but needed for osx
bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'select-pane -t=; copy-mode -e; send-keys -M'"
bind -n WheelDownPane select-pane -t= \; send-keys -M
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment