Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
139 lines (119 sloc) 4.97 KB
#{{{ General Settings
set -g status-keys vi
set -g history-limit 10000
setw -g mode-keys vi
setw -g mouse off
set -g default-terminal "screen-256color"
set -sg escape-time 0
set -g display-time 1000
set -g focus-events on
set -g clock-mode-style 12
set -g allow-rename off
set -g automatic-rename off
set -g renumber-windows on
#}}}
#{{{ Bindings
# set Ctrl-s as the default prefix key combination
# and unbind C-b to free it up
set -g prefix C-s
unbind C-b
unbind '"'
unbind %
# Resource
bind R source-file ~/.tmux.conf
# Hide status bar
bind-key a set -g status
# Toggle last window
bind Enter last-window
# Send C-s to application
bind C-s send-prefix
bind c new-window -c '#{pane_current_path}' -n ''
bind C-n next-window
bind C-p previous-window
bind S choose-session
bind-key P swap-window -t -1
bind-key N swap-window -t +1
bind C break-pane
#{{{ Vi like
# Resize panes
bind-key H resize-pane -L 10
bind-key J resize-pane -D 10
bind-key K resize-pane -U 10
bind-key L resize-pane -R 10
# Selection/copy
bind-key -Tcopy-mode-vi v send -X begin-selection
bind-key -Tcopy-mode-vi C-v send -X rectangle-toggle
bind-key -Tcopy-mode-vi y send -X copy-pipe-and-cancel "xclip -selection clipboard"
bind-key u copy-mode -u
bind-key C-u copy-mode -u
bind-key C-b copy-mode -u
bind ] run "tmux set-buffer \"$(xclip -o -sel clipboard)\"; tmux paste-buffer"
# Split
bind-key s split-window -c '#{pane_current_path}'
bind-key v split-window -h -c '#{pane_current_path}'
# Windows
bind Q kill-window
bind ^ last-window
bind r rotate-window
#}}}
#}}}
#{{{ Color
set-option -g status-bg white
set-option -g status-fg yellow
set-option -g status-attr default
set-window-option -g window-status-fg brightyellow
set-window-option -g window-status-bg default
set-window-option -g window-status-current-fg default
set-window-option -g window-status-current-bg default
set-option -g pane-border-fg white
set-option -g pane-active-border-fg brightyellow
set-option -g message-bg white
set-option -g message-fg brightred
set-option -g display-panes-active-colour blue
set-option -g display-panes-colour brightred
set-window-option -g clock-mode-colour green
set -g pane-active-border-style fg=default
#}}}
#{{{ Status Bar
set-option -g status on
set -g window-status-format " #I "
set -g window-status-current-format " #I "
set -g window-status-activity-style fg=magenta
set -g window-status-bell-style fg=magenta
set -g window-status-current-attr reverse
set -g window-status-activity-attr reverse
set -g window-status-bell-attr reverse
set -g status-right-length 20
set -g status-left-length 20
set -g status-left '#(~/.scripts/echo_info.sh --no-date)'
set -g status-right '#(~/.scripts/echo_info.sh --date-only)'
set -g status-interval 5
set -g status-justify centre
#}}}
#{{{ Plugin manager
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'dequis/tmux-url-select'
run-shell '~/.tmux/plugins/tpm/tpm'
#}}}
#{{{ Plugins configuration
bind o run '~/.tmux/plugins/tmux-url-select/tmux-url-select.pl'
bind C-o run '~/.tmux/plugins/tmux-url-select/tmux-url-select.pl'
#}}}
#{{{ vim-tmux-navigator
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
bind-key C-h if-shell "$is_vim" "send-keys C-h" "run '~/.scripts/ratpoison/rat_tmux-navigator.sh tmux left'"
bind-key C-j if-shell "$is_vim" "send-keys C-j" "run '~/.scripts/ratpoison/rat_tmux-navigator.sh tmux down'"
bind-key C-k if-shell "$is_vim" "send-keys C-k" "run '~/.scripts/ratpoison/rat_tmux-navigator.sh tmux up'"
bind-key C-l if-shell "$is_vim" "send-keys C-l" "run '~/.scripts/ratpoison/rat_tmux-navigator.sh tmux right'"
bind-key -n C-h if-shell "$is_vim" "send-keys C-h" "run '~/.scripts/ratpoison/rat_tmux-navigator.sh tmux left'"
bind-key -n C-j if-shell "$is_vim" "send-keys C-j" "run '~/.scripts/ratpoison/rat_tmux-navigator.sh tmux down'"
bind-key -n C-k if-shell "$is_vim" "send-keys C-k" "run '~/.scripts/ratpoison/rat_tmux-navigator.sh tmux up'"
bind-key -n C-l if-shell "$is_vim" "send-keys C-l" "run '~/.scripts/ratpoison/rat_tmux-navigator.sh tmux right'"
bind-key h if-shell "$is_vim" "send-keys C-h" "run '~/.scripts/ratpoison/rat_tmux-navigator.sh tmux left'"
bind-key j if-shell "$is_vim" "send-keys C-j" "run '~/.scripts/ratpoison/rat_tmux-navigator.sh tmux down'"
bind-key k if-shell "$is_vim" "send-keys C-k" "run '~/.scripts/ratpoison/rat_tmux-navigator.sh tmux up'"
bind-key l if-shell "$is_vim" "send-keys C-l" "run '~/.scripts/ratpoison/rat_tmux-navigator.sh tmux right'"
#}}}
# vim:fdm=marker