-
Notifications
You must be signed in to change notification settings - Fork 1
/
tmux.conf
85 lines (73 loc) · 2.91 KB
/
tmux.conf
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
# Change prefix from Ctrl-b to Ctrl-a
unbind C-b
set -g prefix C-a
# General Settings
## Server Options
set -s escape-time 10 # need this for neovim to work correctly
set -s set-clipboard off # don't try to set system clipboard (only works with xterm)
## Session Options
set -g mouse on
set -g base-index 1 # start numbering from 1
set -g allow-rename off # don't rename named windows
set -g history-limit 10000
set -g visual-activity on
set -g repeat-time 300 # drop repeat time from default of 500 to 300
set -g renumber-windows on # if window is closed, renumber them
set -g default-command "${SHELL}" # tmux starts a login shell by default, make it start a normal shell instead
set -g default-terminal "tmux-256color" # default is "tmux", set "tmux-256color" to enable more colors
set -ga terminal-overrides ",stterm-256color:Tc" # enable 24 bit colors when parent is stterm
set -ga terminal-overrides ",xterm-256color:Tc" # enable 24 bit colors when parent is xterm
## Window Options
setw -g aggressive-resize on
setw -g pane-base-index 1 # number panes from 1 as well
setw -g monitor-activity on
# General Key Bindings
bind a send-prefix
bind C-a last-window
bind r command-prompt "rename-window %1"
bind R source-file ~/.tmux.conf \; display "Config has been reloaded"
bind m command-prompt -p "(man)" "split-window 'exec man %%'"
# Split Pane
bind | split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"
unbind '"'
unbind %
# Key Bindings
# M is ALT key
# -r flag is useful as it allows multiple commands to
# be entered without pressing the prefix-key again
## Panes
### Traversal
unbind Up
unbind Down
unbind Left
unbind Down
bind -r h select-pane -L
bind -r j select-pane -D
bind -r k select-pane -U
bind -r l select-pane -R
### Reszing
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
bind M-H command-prompt "resize-pane -L %%"
bind M-J command-prompt "resize-pane -D %%"
bind M-K command-prompt "resize-pane -U %%"
bind M-L command-prompt "resize-pane -R %%"
## Copy & Paste
set -g mode-keys vi
bind v copy-mode
bind P paste-buffer
bind -T copy-mode-vi v send -X begin-selection # v: begin selecting
bind -T copy-mode-vi y send -X copy-pipe-and-cancel "xclip -sel clip -i" # y: select and exit
bind -T copy-mode-vi MouseDragEnd1Pane send -X copy-pipe-and-cancel "xclip -sel clip -i" # mouse: select and exit
# Plugins
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
set -g @continuum-restore 'on'
set -g @resurrect-capture-pane-contents 'on'
set -g @resurrect-strategy-vim 'session'
set -g @resurrect-strategy-nvim 'session'
# Plugin Manager
run '~/.tmux/plugins/tpm/tpm'