dotfiles/tmux/.tmux.conf

129 lines
3.9 KiB
Text
Raw Normal View History

# change the prefix from 'C-b' to 'M-a'
unbind C-b
set-option -g prefix M-a
bind-key M-a send-prefix
# start with window 1 (instead of 0)
2020-01-04 11:28:05 +01:00
# set -g base-index 1
# start with pane 1
# set -g pane-base-index 1
# split panes using | and -, make sure they open in the same path
bind | split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"
unbind '"'
unbind %
# open new windows in the current path
bind c new-window -c "#{pane_current_path}"
# reload config file
2019-12-12 10:22:12 +01:00
bind r source-file ~/.tmux.conf \; display "Reloaded tmux.conf!"
unbind p
bind p previous-window
# shorten command delay
set -sg escape-time 1
2020-10-18 14:28:49 +02:00
# Increase scrollback buffer size
set -g history-limit 8192
# don't rename windows automatically
set-option -g allow-rename off
# mouse control (clickable windows, panes, resizable panes)
set -g mouse on
set -g focus-events on
# Use Alt-arrow keys without prefix key to switch panes
bind -n M-h select-pane -L
bind -n M-l select-pane -R
bind -n M-k select-pane -U
bind -n M-j select-pane -D
2019-12-12 10:22:12 +01:00
# Pane resizing with HJKL
bind H resize-pane -L 10
bind J resize-pane -D 10
bind K resize-pane -U 10
bind L resize-pane -R 10
# Move windows back/forward
bind -n S-left swap-window -t -1
bind -n S-right swap-window -t +1
2019-12-12 10:28:39 +01:00
bind m command-prompt -p "Merge pane to:" "join-pane -t '%%'"
bind M command-prompt -p "Merge pane from:" "join-pane -s '%%'"
2019-12-12 10:22:12 +01:00
bind e setw synchronize-panes on \; display "Synchronize panes ON (E: off)"
bind E setw synchronize-panes off \; display "Synchronize panes OFF (e: on)"
bind -n M-0 select-window -t 0
2019-12-12 10:22:12 +01:00
bind -n M-1 select-window -t 1
bind -n M-2 select-window -t 2
bind -n M-3 select-window -t 3
bind -n M-4 select-window -t 4
bind -n M-5 select-window -t 5
bind -n M-6 select-window -t 6
bind -n M-7 select-window -t 7
bind -n M-8 select-window -t 8
bind -n M-9 select-window -t 9
bind 0 select-pane -t 0
bind 1 select-pane -t 1
bind 2 select-pane -t 2
bind 3 select-pane -t 3
bind 4 select-pane -t 4
bind 5 select-pane -t 5
bind 6 select-pane -t 6
bind 7 select-pane -t 7
bind 8 select-pane -t 8
bind 9 select-pane -t 9
bind P paste-buffer
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi y send-keys -X copy-selection
bind-key -T copy-mode-vi r send-keys -X rectangle-toggle
# set default terminal mode to 256 colors
# set -g default-terminal "screen-256color"
# set default terminal mode to 256 colors
set-option -g default-terminal "tmux-256color"
set-option -sa terminal-overrides ',tmux-256color:RGB'
set-option -g status-style fg=colour187,bg=colour237
set-window-option -g window-status-style fg=colour187,bg=colour237
set-window-option -g window-status-current-style fg=colour161,bg='#000000'
set-option -g pane-border-style fg='#505050',bg='#101010'
set-option -g pane-active-border-style fg='#87d700',bg='#101010'
set-option -g mode-style fg=colour187,bg='#000000'
set-option -g message-style fg=colour187,bg='#000000'
2019-12-12 09:26:26 +01:00
# Battery
set -g @batt_icon_charge_tier8 '🌕'
set -g @batt_icon_charge_tier7 '🌖'
set -g @batt_icon_charge_tier6 '🌖'
set -g @batt_icon_charge_tier5 '🌗'
set -g @batt_icon_charge_tier4 '🌗'
set -g @batt_icon_charge_tier3 '🌘'
set -g @batt_icon_charge_tier2 '🌘'
set -g @batt_icon_charge_tier1 '🌑'
set -g @batt_icon_status_charged '🔋'
set -g @batt_icon_status_charging '⚡'
set -g @batt_icon_status_discharging '👎'
set -g @batt_color_status_primary_charged '#3daee9'
set -g @batt_color_status_primary_charging '#3daee9'
set -g status-right '#{battery_status_bg} #{battery_icon} #{battery_percentage} #{battery_remain} | %a %h-%d %H:%M '
# Plugins
run-shell '~/.tmux/plugins/tmux-resurrect/resurrect.tmux'
run-shell '~/.tmux/plugins/tmux-continuum/continuum.tmux'
run-shell '~/.tmux/plugins/tmux-yank/yank.tmux'
run-shell '~/.tmux/plugins/tmux-copycat/copycat.tmux'
run-shell '~/.tmux/plugins/tmux-open/open.tmux'
run-shell '~/.tmux/plugins/tmux-butler/tmux-butler.tmux'
run-shell '~/.tmux/plugins/tmux-battery/battery.tmux'
set -g @continuum-restore 'on'