-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.tmux.conf
138 lines (106 loc) · 4.35 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
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
129
130
131
132
133
134
135
136
137
138
# Screen like binding
unbind C-b
set -g prefix C-a
bind a send-prefix
# address vim mode switching delay (http://superuser.com/a/252717/65504)
set -sg escape-time 0
# Use vi keybindings for tmux commandline input.
# Note that to get command mode you need to hit ESC twice...
set -g status-keys vi
# Use vi keybindings in copy and choice modes
setw -g mode-keys vi
# Use vi mode to copy
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
# Bigger history
set -g history-limit 50000
# tmux messages are displayed for 3 seconds
set -g display-time 3000
# set only on OS X where it's required
# set -g default-command "reattach-to-user-namespace -l $SHELL"
# focus events enabled for terminals that support them
set -g focus-events on
# super useful when using "grouped sessions" and multi-monitor setup
setw -g aggressive-resize on
# New windows/pane in $PWD
bind c new-window -c "#{pane_current_path}"
# easily toggle synchronization (mnemonic: e is for echo)
# sends input to all panes in a given window.
bind e setw synchronize-panes on
bind E setw synchronize-panes off
# set first window to index 1 (not 0) to map more to the keyboard layout...
set-option -g base-index 1
set-window-option -g pane-base-index 1
# Ring the bell if any background window rang a bell
set -g bell-action any
# sort the window numbers
set-option -g renumber-windows on
# Default termtype. If the rcfile sets $TERM, that overrides this value.
set -g default-terminal 'xterm-256color'
set -ga terminal-overrides ',xterm-256color:Tc'
# Keep your finger on ctrl, or don't
bind-key ^D detach-client
# Create splits and vertical splits
bind-key v split-window -h -c "#{pane_current_path}"
# bind-key ^V split-window -h -p 50 -c "#{pane_current_path}"
bind-key s split-window -c "#{pane_current_path}"
# bind-key ^S split-window -p 50 -c "#{pane_current_path}"
# Show/Hide status bar
bind-key h set status
# Pane resize in all four directions using vi bindings.
# Can use these raw but I map them to shift-ctrl-<h,j,k,l> in iTerm.
bind -r H resize-pane -L 20
bind -r J resize-pane -D 20
bind -r K resize-pane -U 20
bind -r L resize-pane -R 20
# bind -n C-k clear-history
unbind C
bind-key C send-keys "clear && tmux clear-history" \; send-keys "Enter"
# bind-key X send-keys "clear" \; send-keys "Enter" \; clear-history
# bind-key -n C-l send-keys C-l \; send-keys -R \; clear-history
set-option -g status-justify right
# mouse behavior
set-window-option -g mouse on
# Using set -gq instead of set -g will silence the unknown option error, while still setting it on old versions of tmux
setw -gq mode-mouse on
set -gq mouse-select-pane on
set -gq mouse-resize-pane on
set -gq mouse-select-window on
# Tmux Plugin Mamanger
# Install TPM
# git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
# Run prefix + I to install the plugins
# prefix + U to updates plugin(s)
# prefix + alt + u to remove/uninstall plugins not on the plugin list
set -g @plugin 'tmux-plugins/tpm'
# Smart pane switching with awareness of Vim splits.
# <ctrl-h> => Left <ctrl-j> => Down <ctrl-k> => Up <ctrl-l> => Right
# See: https://github.com/christoomey/vim-tmux-navigator
set -g @plugin 'christoomey/vim-tmux-navigator'
# Add kube context and namespace in status bar
set -g @plugin 'jonmosco/kube-tmux'
# Some common setup
set -g @plugin 'tmux-plugins/tmux-sensible'
# Restore tmux environment after system restart.
# prefix + Ctrl-s - save
# prefix + Ctrl-r - restore
set -g @plugin 'tmux-plugins/tmux-resurrect'
# enable for vim in tmux
# need to install https://github.com/tpope/vim-obsession
# set -g @resurrect-strategy-vim 'session'
set -g @plugin 'nhdaly/tmux-better-mouse-mode'
# set -g @plugin 'dracula/tmux'
# available plugins: battery, cpu-usage, git, gpu-usage, ram-usage, network, network-bandwidth, network-ping, weather, time
# set -g @dracula-plugins "git, time"
set -g @plugin 'egel/tmux-gruvbox#master'
set -g @tmux-gruvbox 'dark'
# highlight in you current tmux visible pane all text that match specific patterns.
set -g @plugin 'fcsonline/tmux-thumbs'
run-shell ~/.tmux/plugins/tmux-thumbs/tmux-thumbs.tmux
run '~/.tmux/plugins/tpm/tpm'
# force a reload of the config file
unbind r
bind r source-file ~/.tmux.conf \; display "Reloaded!"
# Local config
if-shell "[ -f ~/.tmux.conf.local ]" 'source ~/.tmux.conf.local'