~gpanders/dotfiles

ref: 2da1dde5ea566f82ebe6532bc6d3b8670fd77ce8 dotfiles/tmux/.config/tmux/tmux.conf -rw-r--r-- 3.9 KiB
2da1dde5Greg Anders Note 'open' subcommand opens editor in NOTES_DIR when no argument given 1 year, 4 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
# Change prefix
unbind C-b
set -g prefix C-a
bind C-a send-prefix
bind a last-window

# Report $TERM as tmux-256color
# Some systems don't have this description in their terminfo database.  If that
# is the case then this will cause errors. The solution is to either install
# the tmux-256color terminfo description or change this value to
# screen-256color.
set -s default-terminal "tmux-256color"

# Enable true colors
set -as terminal-overrides ',*:Tc'

# Set time (in milliseconds) for which tmux waits after an escape key to see if
# it's part of a key combination
set -s escape-time 10

# Setting default-command instead of defualt-shell makes tmux start each new
# window as a non-login interactive shell
set -g default-command $SHELL

# Automatically renumber windows when one is closed
set -g renumber-windows on

# Increase scrollback buffer size
set -g history-limit 5000

# Refresh status bar every 5 seconds (default is 15)
set -g status-interval 5

# Use readline (emacs) keys on the tmux command line
set -g status-keys emacs

# Enable focus events
set -g focus-events on

# Reload tmux.conf
bind R source-file ~/.config/tmux/tmux.conf \; display-message "Reloaded tmux.conf"

# Use prefix + \ and prefix + - to split the current pane
bind \\ split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"

# Use prefix + | and prefix + _ to split the current window along its full
# height/width
bind | split-window -f -h -c "#{pane_current_path}"
bind _ split-window -f -v -c "#{pane_current_path}"

# New windows should start in the same directory as the current one
bind c new-window -c "#{pane_current_path}"

# Make switching between windows easier
bind C-p previous-window
bind C-n next-window

# Use vi-style key bindings to navigate between panes
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
bind C-h select-pane -L
bind C-j select-pane -D
bind C-k select-pane -U
bind C-l select-pane -R

# Make u and d scroll up/down in copy mode (like a pager)
bind -T copy-mode-vi u send-keys -X halfpage-up
bind -T copy-mode-vi d send-keys -X halfpage-down

# Clear selection in copy mode with (C-L)
bind -T copy-mode-vi C-l send-keys -X clear-selection

# Use prefix + < or prefix + > to move windows
bind < swap-window -t -1
bind > swap-window -t +1

# Easily resize panes with prefix + H/J/K/L
# The -r flag means these are repeatable
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

# Use vi keys in copy-mode
set -gw mode-keys vi

# Enable mouse
set -g mouse on
set -g @scroll-without-changing-pane "on"
set -g @scroll-speed-num-lines-per-scroll "5"
bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'copy-mode -e'"

# Start window indexing at 1 instead of 0
set -g base-index 1

# Status bar
set -g status-left ""
set -g status-right "#{prefix_highlight} #[#{E:status-right-style}]#S "
set -gw window-status-format " #[fg=colour1]#I#[#{E:window-status-style}] #W#F "
set -gw window-status-current-format " #[fg=colour1]#I#[#{E:window-status-current-style}] #W#F "
set -gw window-status-separator ""

# Set processes to restore with tmux-resurrect
set -g @resurrect-processes "ssh"
set -g @resurrect-dir "$HOME/.local/share/tmux/resurrect/"

set -g @prefix_highlight_empty_prompt "    "

# Set color scheme
colors="$HOME/.config/tmux/colors/base16.conf"
if "test -r $colors" "source $colors"

setenv -g TMUX_PLUGIN_MANAGER_PATH "$HOME/.local/share/tmux/plugins/"

# List of plugins
set -g @plugin "tmux-plugins/tpm"
set -g @plugin "tmux-plugins/tmux-prefix-highlight"
set -g @plugin "tmux-plugins/tmux-yank"
set -g @plugin "tmux-plugins/tmux-copycat"
set -g @plugin "tmux-plugins/tmux-open"
set -g @plugin "tmux-plugins/tmux-resurrect"
set -g @plugin "tmux-plugins/tmux-sessionist"

# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run -b "$HOME/.local/share/tmux/plugins/tpm/tpm"