2019-02-27 13:42:45 +00:00
|
|
|
# Layout of this conf file:
|
|
|
|
# 1. Global Settings
|
2022-11-04 14:23:40 +00:00
|
|
|
# 2. Plugins
|
2019-02-27 13:42:45 +00:00
|
|
|
# 3. Keybinds
|
|
|
|
# 4. Theme
|
|
|
|
|
|
|
|
# For rapid change prototyping, disabled normally:
|
|
|
|
# bind-key r source-file ~/.config/tmux/tmux.conf \; display-message "config reloaded."
|
|
|
|
|
|
|
|
######################
|
|
|
|
### 1. GLOBAL SETTINGS
|
|
|
|
######################
|
2019-02-04 12:12:59 +00:00
|
|
|
|
|
|
|
# show that activity happens but don't display a huge 'activity happening' notification
|
|
|
|
setw -g monitor-activity on
|
|
|
|
set -g visual-activity off
|
|
|
|
|
|
|
|
# Start counting windows and panes at 1
|
|
|
|
set -g base-index 1
|
|
|
|
setw -g pane-base-index 1
|
2019-02-27 13:42:45 +00:00
|
|
|
set -g renumber-windows on
|
2019-02-04 12:12:59 +00:00
|
|
|
|
|
|
|
# Terminal improvements
|
|
|
|
set-window-option -g automatic-rename on
|
|
|
|
set-option -g set-titles on
|
|
|
|
set -g mouse on
|
2020-02-20 19:43:34 +00:00
|
|
|
# allow truecolor support
|
2021-02-19 15:12:06 +00:00
|
|
|
set -g default-terminal 'xterm-256color'
|
|
|
|
set -ga terminal-overrides ',xterm-256color:Tc'
|
2019-02-04 12:12:59 +00:00
|
|
|
set -g status-keys vi
|
2022-11-04 14:23:40 +00:00
|
|
|
set-window-option -g mode-keys vi
|
2019-02-04 12:12:59 +00:00
|
|
|
set -g history-limit 10000
|
|
|
|
|
2019-02-27 13:42:45 +00:00
|
|
|
# Screen size is based on the smallest client looking at the current windows, not the smallest
|
|
|
|
# client connected to the overall session. If two clients are connected to the same session but not
|
|
|
|
# looking at the same window, why would they care about each others screen size?
|
|
|
|
setw -g aggressive-resize on
|
2019-02-04 12:12:59 +00:00
|
|
|
|
|
|
|
# No delay for escape key press
|
|
|
|
set -sg escape-time 0
|
|
|
|
|
2021-02-19 15:12:06 +00:00
|
|
|
# to enable autoread option in neovim
|
|
|
|
set-option -g focus-events on
|
2019-02-04 12:12:59 +00:00
|
|
|
|
2019-02-27 13:42:45 +00:00
|
|
|
####################
|
|
|
|
## 2. PLUGINS ##
|
|
|
|
####################
|
2019-02-04 12:12:59 +00:00
|
|
|
|
2020-02-06 19:30:35 +00:00
|
|
|
set -g @tpm_plugins ' \
|
|
|
|
tmux-plugins/tpm \
|
|
|
|
tmux-plugins/tmux-sensible \
|
|
|
|
christoomey/vim-tmux-navigator \
|
|
|
|
Morantron/tmux-fingers \
|
|
|
|
'
|
2019-02-04 16:15:31 +00:00
|
|
|
|
2020-02-06 19:30:35 +00:00
|
|
|
set -g @fingers-key F
|
2019-07-08 20:06:56 +00:00
|
|
|
|
2020-02-06 19:30:35 +00:00
|
|
|
# make sure tpm is installed
|
|
|
|
if-shell "test ! -d $TMUX_PLUGIN_MANAGER_PATH/tpm" \
|
|
|
|
"run 'git clone https://github.com/tmux-plugins/tpm $TMUX_PLUGIN_MANAGER_PATH/tpm && $TMUX_PLUGIN_MANAGER_PATH/tpm/bin/install_plugins'" \
|
|
|
|
|
|
|
|
# optinally add this to install plugins on each start -- adds small lag to startup
|
|
|
|
# "run-shell $TMUX_PLUGIN_MANAGER_PATH/tpm/bin/install_plugins"
|
2019-02-25 09:33:48 +00:00
|
|
|
|
2019-02-27 13:42:45 +00:00
|
|
|
#####################
|
|
|
|
## 3. KEYBINDINGS ##
|
|
|
|
#####################
|
|
|
|
|
|
|
|
# Unbind some defaults
|
|
|
|
unbind '"'
|
|
|
|
unbind %
|
|
|
|
|
|
|
|
# Custom modifier key
|
|
|
|
set -g prefix C-a
|
|
|
|
unbind-key C-b
|
|
|
|
bind-key -r C-a send-prefix
|
|
|
|
|
|
|
|
# Window Navigation - Prefix + Vim Keys
|
|
|
|
bind-key -r C-h select-window -t :-
|
|
|
|
bind-key -r C-l select-window -t :+
|
|
|
|
|
|
|
|
# Resize Panes
|
|
|
|
bind-key -r H resize-pane -L 3
|
|
|
|
bind-key -r J resize-pane -D 1
|
|
|
|
bind-key -r K resize-pane -U 1
|
|
|
|
bind-key -r L resize-pane -R 3
|
|
|
|
|
|
|
|
bind-key -r C-H resize-pane -L 10
|
|
|
|
bind-key -r C-J resize-pane -D 5
|
|
|
|
bind-key -r C-K resize-pane -U 5
|
|
|
|
bind-key -r C-L resize-pane -R 10
|
|
|
|
|
|
|
|
# Send Pane to a new window (but stay on current window), join it back into the current window
|
|
|
|
bind-key B break-pane -d
|
|
|
|
bind-key C-b command-prompt -p "join pane from: " "join-pane -h -s '%%'"
|
|
|
|
|
|
|
|
# Swap panes within the current window (swaps pane # entered with currently selected pane)
|
|
|
|
bind-key b display-panes\; command-prompt -p "pane #: " "swap-pane -t '%%'"
|
|
|
|
|
|
|
|
# Kill tabs quicker
|
|
|
|
bind-key x kill-pane
|
|
|
|
bind-key C-x kill-window
|
|
|
|
|
|
|
|
# Split Window into panes - automatically handled by plugin
|
2019-11-29 20:05:50 +00:00
|
|
|
bind-key '\' split-window -h -c '#{pane_current_path}'
|
|
|
|
bind-key '-' split-window -v -c '#{pane_current_path}'
|
2019-02-27 13:42:45 +00:00
|
|
|
|
|
|
|
# Open a sessions chooser
|
2020-11-13 09:10:51 +00:00
|
|
|
bind C-s split-window -v "tmux list-sessions | sed -E 's/:.*$//' | grep -v \"^$(tmux display-message -p '#S')\$\" | fzf --reverse | xargs tmux switch-client -t"
|
2019-02-27 13:42:45 +00:00
|
|
|
|
2022-11-04 14:23:40 +00:00
|
|
|
# Make visual selections act a little more like vim
|
|
|
|
bind-key -T copy-mode-vi v send -X begin-selection
|
|
|
|
bind-key -T copy-mode-vi V send -X select-line
|
|
|
|
bind-key -T copy-mode-vi y send -X copy-pipe-and-cancel 'wl-copy' \; send -X rectangle-off
|
|
|
|
bind-key -T copy-mode-vi 'C-v' send -X begin-selection \; send -X rectangle-on
|
|
|
|
|
2019-02-27 13:42:45 +00:00
|
|
|
#####################
|
|
|
|
## 4. THEME ##
|
|
|
|
#####################
|
2019-02-26 09:45:28 +00:00
|
|
|
|
2019-02-25 09:33:48 +00:00
|
|
|
# Status update interval
|
|
|
|
set -g status-interval 1
|
2019-03-13 16:19:27 +00:00
|
|
|
# Clock mode
|
|
|
|
set -g clock-mode-colour colour24
|
|
|
|
set -g clock-mode-style 24
|
2019-02-25 09:33:48 +00:00
|
|
|
|
2019-03-13 16:19:27 +00:00
|
|
|
# This tmux statusbar config was created by tmuxline.vim
|
|
|
|
# on Wed, 13 Mar 2019
|
|
|
|
|
2019-05-23 07:45:48 +00:00
|
|
|
set -g message-command-style bg="#2e2e2e",fg="#c8c8c8"
|
|
|
|
set -g message-style bg="#2e2e2e",fg="#c8c8c8"
|
|
|
|
set -g pane-active-border-style fg="#2e2e2e"
|
|
|
|
set -g pane-border-style fg="#2e2e2e"
|
2019-03-13 16:19:27 +00:00
|
|
|
set -g status-justify "centre"
|
|
|
|
set -g status "on"
|
2019-05-23 07:45:48 +00:00
|
|
|
set -g status-style "none"
|
|
|
|
set -g status-style "none"
|
2019-03-13 16:19:27 +00:00
|
|
|
set -g status-left-length "100"
|
|
|
|
set -g status-right-length "100"
|
2019-05-23 07:45:48 +00:00
|
|
|
setw -g window-status-style fg="#c8c8c8",bg="#2e2e2e","none"
|
|
|
|
setw -g window-status-activity-style bg="#2e2e2e",fg="#c8c8c8","underscore"
|
2019-03-13 16:19:27 +00:00
|
|
|
setw -g window-status-separator ""
|
2020-12-03 11:30:17 +00:00
|
|
|
set -g status-left "#[fg=#c8c8c8,bg=#2e2e2e] #S #[fg=#2e2e2e,bg=#2e2e2e,nobold,nounderscore,noitalics]#[fg=#c8c8c8,bg=#2e2e2e] #I:#P #[fg=#2e2e2e,bg=#2e2e2e,nobold,nounderscore,noitalics]#[fg=#c8c8c8,bg=#2e2e2e] #[fg=#2e2e2e,bg=#2e2e2e,nobold,nounderscore,noitalics]"
|
|
|
|
set -g status-right "#[fg=#2e2e2e,bg=#2e2e2e,nobold,nounderscore,noitalics] #[fg=#c8c8c8,bg=#2e2e2e] #{?client_prefix,#[fg=colour232]#[bg=brightblue],} #(whoami) #[fg=#2e2e2e,bg=#2e2e2e,nobold,nounderscore,noitalics]#[fg=#c8c8c8,bg=#2e2e2e] %d-%b-%y #[fg=#2e2e2e,bg=#2e2e2e,nobold,nounderscore,noitalics]#[fg=#c8c8c8,bg=#2e2e2e] #H "
|
2019-03-13 16:19:27 +00:00
|
|
|
setw -g window-status-format "#[fg=#2e2e2e,bg=#2e2e2e,nobold,nounderscore,noitalics]#[default] #I #W #[fg=#2e2e2e,bg=#2e2e2e,nobold,nounderscore,noitalics]"
|
|
|
|
setw -g window-status-current-format "#[fg=#2e2e2e,bg=#2e2e2e,nobold,nounderscore,noitalics]#[fg=#c8c8c8,bg=#2e2e2e] #I #W #[fg=#2e2e2e,bg=#2e2e2e,nobold,nounderscore,noitalics]"
|
2019-07-27 12:29:47 +00:00
|
|
|
|
|
|
|
########################
|
|
|
|
## 5. Nested Sessions ##
|
|
|
|
########################
|
|
|
|
# from: https://github.com/samoshkin/tmux-config/blob/master/tmux/tmux.conf
|
|
|
|
# all credit to samoshkin
|
|
|
|
|
|
|
|
# Session is considered to be remote when we ssh into host
|
|
|
|
if-shell 'test -n "$SSH_CLIENT"' \
|
|
|
|
'source-file $XDG_CONFIG_HOME/tmux/tmux.remote.conf'
|
|
|
|
|
|
|
|
# We want to have single prefix key "C-a", usable both for local and remote session
|
|
|
|
# we don't want to "C-a" + "a" approach either
|
|
|
|
# Idea is to turn off all key bindings and prefix handling on local session,
|
|
|
|
# so that all keystrokes are passed to inner/remote session
|
|
|
|
|
|
|
|
# see: toggle on/off all keybindings · Issue #237 · tmux/tmux - https://github.com/tmux/tmux/issues/237
|
|
|
|
|
|
|
|
# Also, change some visual styles when window keys are off
|
|
|
|
bind -T root F12 \
|
|
|
|
set prefix None \;\
|
|
|
|
set key-table off \;\
|
|
|
|
set status-style fg="colour245",bg="colour238" \;\
|
|
|
|
set window-status-current-format "#[fg=$color_window_off_status_bg,bg=$color_window_off_status_current_bg]$separator_powerline_right#[default] #I:#W# #[fg=$color_window_off_status_current_bg,bg=$color_window_off_status_bg]$separator_powerline_right#[default]" \;\
|
|
|
|
set window-status-current-style fg="colour232",bg="colour254","bold" \;\
|
|
|
|
if -F '#{pane_in_mode}' 'send-keys -X cancel' \;\
|
|
|
|
refresh-client -S \;\
|
|
|
|
|
|
|
|
bind -T off F12 \
|
|
|
|
set -u prefix \;\
|
|
|
|
set -u key-table \;\
|
|
|
|
set -u status-style \;\
|
|
|
|
set -u window-status-current-style \;\
|
|
|
|
set -u window-status-current-format \;\
|
|
|
|
refresh-client -S
|
2020-02-06 19:30:35 +00:00
|
|
|
|
|
|
|
run -b "$TMUX_PLUGIN_MANAGER_PATH/tpm/tpm"
|