Files
dotfiles/tmux.conf

119 lines
3.5 KiB
Bash

# Bind tmux prefix to Ctrl-B
set -g prefix C-b
# But give us a way to send it through if necessary.
bind C-b send-prefix
# Fix home/end (in particular in Emacs); see https://stackoverflow.com/a/55616731
bind-key -n Home send Escape "OH"
bind-key -n End send Escape "OF"
# Start window numbering at 1, not 0.
set -g base-index 1
# Same for panes, to be consistent.
set -w -g pane-base-index 1
# run-shell ~/src/tmux-resurrect/resurrect.tmux
bind C-l send-keys 'C-l'
bind r \
source ~/.tmux.conf\; \
display "Configuration reloaded."
# Save entire pane history to a file.
bind-key P \
command-prompt -p 'save history to filename:' -I '~/tmux.history' 'capture-pane -S -32768 ; save-buffer %1 ; delete-buffer'
# Turn on focus events, used by (for example) Vim.
set -g focus-events on
# Reduce time waited to see if a key is escape alone or an escape sequence.
set -sg escape-time 10
# Easier to remember keys for splitting panes.
bind | split-window -h
bind - split-window -v
# Additional pane navigation.
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# And resizing, with repeatable bindings.
bind -r H resize-pane -L 5
bind -r J resize-pane -D 5
bind -r K resize-pane -U 5
bind -r L resize-pane -R 5
# Enable vi keys for moving around
set -w -g mode-keys vi
# To go with that, make 'v' start visual selection and 'y' copy the selection.
bind -T copy-mode-vi v send -X begin-selection
bind -T copy-mode-vi y send -X copy-selection
# I'm not a keyboard fanatic; however, if the mouse is enabled it stops "click to highlight" (for example, in PuTTY/MobaXterm etc)
set -g mouse off
# Enable the pretty colours...
# If there are problems with outdated ncurses's's's, we can use "screen-256color" instead.
# set -g default-terminal "tmux-256color"
# Try and make clipboard work?
# Allow things inside tmux to set system clipboard. That's what I expect anyway so let's try it.
# set -gs set-clipboard on
# set -as terminal-features ',rxvt-unicode-256color:clipboard'
# set -as terminal-features ',tmux-256color:clipboard'
# set -as terminal-features ',xterm-256color:clipboard'
# Override terminal for 32-bit RGB colour. (Disabled for now, need to test with MobaXterm.)
# set -a terminal-overrides ",*256col*:RGB"
# Make it obvious which pane we're in.
# set -w -g pane-active-border-style fg=black,bg=color140
# set -g pane-border-indicators arrows
# Give the panes their own status indicator.
set -g pane-border-status top
# Centre the window List
set -g status-justify centre
# Automatically renumber windows if we move them around.
set -g renumber-windows on
# Let me know if something's happened
# set -w -g monitor-activity on
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
# set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
set -g @plugin 'tmux-plugins/tmux-sidebar'
# set -g @plugin 'seebi/tmux-colors-solarized'
set -g @plugin "nordtheme/tmux"
# Other examples:
# set -g @plugin 'github_username/plugin_name'
# set -g @plugin 'git@github.com/user/plugin'
# set -g @plugin 'git@bitbucket.com/user/plugin'
# set -g @resurrect-strategy-vim 'session'
set -g @continuum-restore 'on'
# Load OS-specific settings
if-shell "uname | grep -q Linux" "source-file ~/.tmux.linux.conf"
if-shell "uname | grep -q Darwin" "source-file ~/.tmux.mac.conf"
# Load any system-specific/private settings
if-shell "[ -f ~/.tmux.private]" "source ~/.tmux.private"
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run -b '~/.tmux/plugins/tpm/tpm'