Skip to content

Instantly share code, notes, and snippets.

@johnewart
Last active August 6, 2019 20:12
Show Gist options
  • Save johnewart/6c2a694731ae1813166f to your computer and use it in GitHub Desktop.
Save johnewart/6c2a694731ae1813166f to your computer and use it in GitHub Desktop.
tmux config
# command prefix (like screen)
set -g prefix `
bind ` send-prefix
unbind C-b
bind-key F11 set-option -g prefix C-b
bind-key F12 set-option -g prefix `
set-option -g terminal-overrides 'xterm*:smcup@:rmcup@'
set-option -g default-terminal "screen-256color"
set -g default-terminal "screen-256color"
#set-option -g default-command "reattach-to-user-namespace -l zsh"
unbind % # Remove default binding since we’re replacing
# mouse support
set-window-option -g mouse on
# basic settings
set-window-option -g mode-keys vi # vi key
set-option -g status-keys vi
set-window-option -g utf8 on # utf8 support
set-window-option -g mode-mouse off # disable mouse
#set-option -g mouse-resize-pane on
set-option -g mouse-select-pane off
# copy mode to escape key
unbind [
bind Escape copy-mode
# splitting and cycling
set-option -g mouse-select-pane off
unbind %
bind | split-window -h
unbind '"'
unbind '_'
bind '_' split-window -v
bind C-j previous-window
bind C-k next-window
# window title
set-option -g set-titles on
set-option -g set-titles-string '#S:#I.#P #W' # window number,program name,active (or not)
set-window-option -g automatic-rename on # auto name
set -g update-environment "DISPLAY SSH_ASKPASS WINDOWID XAUTHORITY SSH_AUTH_SOCK SSH_AGENT_PID SSH_CONNECTION"
set-environment -g 'SSH_AUTH_SOCK' '/home/jewart/.ssh/ssh_auth_sock'
# messages
#set-window-option -g mode-bg magenta
#set-window-option -g mode-fg black
#set-option -g message-bg magenta
#set-option -g message-fg black
# No visual activity
#set -g visual-activity off
#set -g visual-bell off
#next tab
bind-key -n C-right next
#previous tab
bind-key -n C-left prev
# status bar
#set-option -g status-utf8 on
#set-option -g status-justify right
set-option -g status-bg black
set-option -g status-fg white
##set-option -g status-interval 5
#set-option -g status-left-length 20
#set-option -g status-left '#[fg=magenta #[fg=blue,bold]#T#[default]'
#set-option -g status-right '#[fg=cyan]»» #[fg=blue,bold]###S #[fg=magenta]%R %m-%d#(uptime | cut -d "," -f2-)#[default]'
#set-option -g status-right '#(uptime | cut -d "," -f 2-)'
#set-option -g status-right '#(uptime|cut -d "," -f 4-|cut -d ":" -f 2-)'
#set -g status-interval 2
#set -g status-right "#[bg=,bold]#(tmux-mem-cpu-load 2)#[default]"
#set-option -g visual-activity off
#set-window-option -g monitor-activity on
#set-window-option -g window-status-current-fg white
# powerline status bar
#set-option -g status on
#set-option -g status-interval 2
#set-option -g status-utf8 on
#set-option -g status-justify "left"
#set-option -g status-left-length 8
#set-option -g status-right-length 80
#set-option -g status-left "#(~/.tmux/tmux-powerline/powerline.sh left)"
#set-option -g status-right "#(~/.tmux/tmux-powerline/powerline.sh right)"
source /usr/local/lib/python2.7/site-packages/powerline/bindings/tmux/powerline.conf
#source "/usr/local/lib/python2.7/site-packages/powerline/bindings/tmux/powerline_tmux_1.9_plus.conf"
# clock
set-window-option -g clock-mode-colour cyan
set-window-option -g clock-mode-style 24
# resize panes
unbind-key ^j ; bind-key -r ^j resize-pane -D 5
unbind-key ^k ; bind-key -r ^k resize-pane -U 5
unbind-key ^h ; bind-key -r ^h resize-pane -L 5
unbind-key ^l ; bind-key -r ^l resize-pane -R 5
# move panes
bind-key -r h select-pane -L
bind-key -r j select-pane -D
bind-key -r k select-pane -U
bind-key -r l select-pane -R
unbind-key -n C-up
unbind-key -n C-down
unbind-key -n C-left
unbind-key -n C-right
#bind-key -n C-up select-pane -U
#bind-key -n C-down select-pane -D
#bind-key -n C-left select-pane -L
#bind-key -n C-right select-pane -R
unbind-key r
bind-key r source-file ~/.tmux.conf \; display-message "Config reloaded..."
bind-key ` select-pane -t :.+
# Pane selections
bind-key -n F1 select-pane -t 0
bind-key -n F2 select-pane -t 1
bind-key -n F3 select-pane -t 2
bind-key -n F4 select-pane -t 3
bind-key -n F5 select-pane -t 4
bind-key -n F6 select-pane -t 5
unbind-key up
unbind-key down
unbind-key left
unbind-key right
#unbind +
#bind + new-window -d -n tmux-zoom 'clear && echo TMUX ZOOM && read' \; swap-pane -s tmux-zoom.0 \; select-window -t tmux-zoom
#unbind -
#bind - last-window \; swap-pane -s tmux-zoom.0 \; kill-window -t tmux-zoom
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment