Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
150 lines (120 sloc) 4.12 KB
## command prefix CTRL+a (like screen)
set -g prefix C-a
bind C-a send-prefix
# config reloading CTRL+r
bind C-r source-file ~/.tmux.conf \; display "Reloaded .tmux.conf"
# enable switching panes, scrolling, and copy-mode by using mouse
set -g mouse on
# lots of scrollback
set -g history-limit 10000
## basic settings
set-window-option -g mode-keys vi
set-option -g status-keys vi
set -g default-terminal "xterm-256color"
## 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
# no delay for escape key press
set -sg escape-time 0
# extend repeat last command timer; makes resizing windows easier.
set -g repeat-time 1000
## no visual activity
set -g visual-activity off
set -g visual-bell off
## status bar generated by Tmuxline
set -g status 'on'
set -g status-bg 'colour236'
set -g status-attr 'none'
set -g status-justify 'left'
set -g status-left-length '100'
set -g status-left-attr 'none'
set -g status-right-length '100'
set -g status-right-attr 'none'
set -g status-left '#[fg=colour231,bg=colour236,bold] #S '
set -g status-right '#[fg=colour231,bg=colour236] ⮃ %Y-%m-%d ⮃ %l:%M:%p ⮃ #(uptime | cut -d "," -f3- | cut -d ":" -f2) ⮃ #{battery_percentage} #[fg=colour231,bg=colour236,nobold,nounderscore,noitalics]⮂#[fg=colour236,bg=colour231,bold] #h '
set -g message-command-bg 'colour231'
set -g message-command-fg 'colour236'
set -g message-bg 'colour236'
set -g message-fg 'colour231'
set -g pane-active-border-fg 'colour254'
set -g pane-border-fg 'colour240'
setw -g window-status-bg 'colour236'
setw -g window-status-fg 'colour231'
setw -g window-status-attr 'none'
setw -g window-status-activity-bg 'colour236'
setw -g window-status-activity-attr 'none'
setw -g window-status-activity-fg 'colour231'
setw -g window-status-separator ''
setw -g window-status-format '#[fg=color236,bg=colour231] #I: #W '
setw -g window-status-current-format '#[fg=colour236,bg=colour231,nobold,nounderscore,noitalics]⮀#[fg=colour236,bg=colour231] #I: #[fg=colour236,bg=colour231,bold]#W #[fg=colour231,bg=colour236,nobold,nounderscore,noitalics]⮀'
# Keybinds {{{
# screen-like last-window binding
bind C-b last-window
# screen-like last-pane binding
bind Tab last-pane
## copy mode to escape key
unbind [
bind Escape copy-mode
## bind paste to P
unbind P
bind P paste-buffer
## splitting and cycling
unbind %
unbind '"'
bind + split-window -h # horizontal split
bind _ split-window -v # vertical split
bind | command-prompt -p command: "split-window -h %%"
bind - command-prompt -p command: "split-window -v %%"
# moving panes around
#unbind !
#bind < break-pane
#bind > choose-tree -b 'join-pane -s %%' -c 'join-pane -s %%'
# vim-style keybinds {{{
## select pane
unbind Up
unbind Down
unbind Left
unbind Right
bind j select-pane -D
bind k select-pane -U
bind h select-pane -L
bind l select-pane -R
# resizing
unbind C-Up
unbind C-Down
unbind C-Left
unbind C-Right
bind -r J resize-pane -D
bind -r K resize-pane -U
bind -r H resize-pane -L
bind -r L resize-pane -R
# fast resizing w/ Mod
unbind M-Up
unbind M-Down
unbind M-Left
unbind M-Right
bind -r C-J resize-pane -D 5
bind -r C-K resize-pane -U 5
bind -r C-H resize-pane -L 5
bind -r C-L resize-pane -R 5
# window selection
bind -n M-Left previous-window
bind -n M-Right next-window
# }}}
## start copy buffer sync script for MacOS
bind 0 run '~/sync/bin/sync-tmux-cb.sh'
## alias for running a command across all sessions, windows and panes
bind P command-prompt -p "Command:" \
"run \"tmux list-sessions -F '##{session_name}' | xargs -I SESS \
tmux list-windows -t SESS -F 'SESS:##{window_index}' | xargs -I SESS_WIN \
tmux list-panes -t SESS_WIN -F 'SESS_WIN.##{pane_index}' | xargs -I SESS_WIN_PANE \
tmux send-keys -t SESS_WIN_PANE '%1' Enter\""
## TODO: alias for running a command across all windows and panes within the current session
## TODO: alias for running a command across all panes within the current window
# }}}
# Plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-battery'
# Initialize TMUX plugin manager
run '~/.tmux/plugins/tpm/tpm'