-
Notifications
You must be signed in to change notification settings - Fork 0
/
tmux.conf
153 lines (128 loc) · 5.06 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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
################################################################################
# General
################################################################################
# utf-8 on
set -gq utf8 on # Tmux < 2.2
set -gq status-utf8 on # Tmux < 2.2
# address vim mode switching delay (http://superuser.com/a/252717/65504)
set -s escape-time 0
# tmux messages are displayed for 4 seconds
set -g display-time 4000
# Increase scrollback buffer size
set -g history-limit 10000
# Allow automatic renaming of windows
set -g allow-rename on
# Set a terminal that apps will know how to handle
#set -g default-terminal "screen-256color"
set -g default-terminal "tmux-256color"
set -as terminal-overrides ',*:Smulx=\E[4::%p1%dm'
# Allow tmux to set the titlebar
set -g set-titles on
# Keep current directory in new splits
bind '"' split-window -v -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
# Start window and pane numbering from 1 for easier switching
set -g base-index 1
set -g pane-base-index 1
set-window-option -g pane-base-index 1
# How long to display the pane number on PREFIX-q
set -g display-panes-time 3000 # 3s
# How long to wait for repeated keys bound with bind -r
set -g repeat-time 2000 # 2s
# Monitor window activity to display in the status bar
set-window-option -g monitor-activity on
# A bell in another window should cause a bell in the current window
set -g bell-action any
# Don't show distracting notifications
set -g visual-bell off
set -g visual-activity off
# 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
# don't detach tmux when killing a session
set -g detach-on-destroy off
setw -g mode-keys vi
# ################################################################################
# # Key Binding
# ################################################################################
#
# # -r means that the bind can repeat without entering prefix again
# # -n means that the bind doesn't use the prefix
#
# # Ensure prefix is Ctrl+B
# set -g prefix C-Space
#
# # Send prefix to a nested tmux session by doubling the prefix
# bind C-Space send-prefix
#
# # 'PREFIX r' to reload of the config file
# unbind r
# bind r source-file ~/.tmux.conf\; display-message '~/.tmux.conf reloaded'
#
# # Allow holding Ctrl when using using prefix+p/n for switching windows
# bind C-p previous-window
# bind C-n next-window
#
# # Move around panes like in vim
# bind -r h select-pane -L
# bind -r j select-pane -D
# bind -r k select-pane -U
# bind -r l select-pane -R
# bind -r C-h select-window -t :-
# bind -r C-l select-window -t :+
#
# # Smart pane switching with awareness of vim splits
# is_vim='echo "#{pane_current_command}" | grep -iqE "(^|\/)g?(view|n?vim?)(diff)?$"'
# bind -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
# bind -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
# bind -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U"
# bind -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R"
#
# # Switch between previous and next windows with repeatable
# bind -r n next-window
# bind -r p previous-window
#
# # Move the current window to the next window or previous window position
# bind -r N run-shell "tmux swap-window -t $(expr $(tmux list-windows | grep \"(active)\" | cut -d \":\" -f 1) + 1)"
# bind -r P run-shell "tmux swap-window -t $(expr $(tmux list-windows | grep \"(active)\" | cut -d \":\" -f 1) - 1)"
#
# # Switch between two most recently used windows
# bind Space last-window
#
# # use PREFIX+| (or PREFIX+\) to split window horizontally and PREFIX+- or
# # (PREFIX+_) to split vertically also use the current pane path to define the
# # new pane path
# bind | split-window -h -c "#{pane_current_path}"
# bind - split-window -v -c "#{pane_current_path}"
#
# # Change the path for newly created windows
# bind c new-window -c "#{pane_current_path}"
#
# Setup 'v' to begin selection as in Vim
bind-key -T copy-mode-vi v send-keys -X begin-selection;
bind y run -b "tmux show-buffer | xclip -selection clipboard"\; display-message "Copied tmux buffer to system clipboard"
# bind-key -r F new-window t
# bind-key -r D run-shell "t ~/.dotfiles"
################################################################################
# Local overrides
################################################################################
if-shell "[ -f ~/.tmux_local.conf ]" 'source ~/.tmux_local.conf'
# ################################################################################
# # Plugins
# ################################################################################
#
# set -g @plugin 'tmux-plugins/tpm'
#
# set -g @plugin 'dracula/tmux'
# set -g @dracula-show-battery false
# set -g @dracula-show-network false
# set -g @dracula-show-weather false
# set -g @dracula-show-powerline true
# set -g @dracula-show-flags true
# set -g @dracula-military-time true
# set -g @dracula-show-left-icon session
# set -g @dracula-day-month true
# set -g @dracula-left-icon-padding 0
#
# run -b '~/.tmux/plugins/tpm/tpm'