-
Notifications
You must be signed in to change notification settings - Fork 11
/
tmux.conf
151 lines (120 loc) ยท 4.83 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
# Options
set -g default-terminal "xterm-256color"
set -ag terminal-overrides ",xterm-256color:Tc"
set -g base-index 1
set -g pane-base-index 1
set -g set-titles on
set -g status-keys vi
setw -gq utf8 on
set -gq status-utf8 on
set-option -g focus-events on
# Faster Command Sequences
set -s escape-time 0
set -g set-clipboard on
set -g history-limit 50000
set-option -g default-command "zsh --login"
if-shell 'test "$(uname)" = "Darwin"' 'source ~/.tmux.osx.conf'
# copy environment variables
set -g update-environment -r
set-option -ga terminal-overrides ",xterm-256color:Tc"
# Window options
setw -g mode-keys vi # vi key
setw -g xterm-keys on
setw -g automatic-rename on
setw -g monitor-activity on
setw -g aggressive-resize on
# allow mouse to enter copy mode and initiate selection
set-option -g mouse on
set-option -g repeat-time 0
set -g pane-active-border-style "fg=blue bg=default"
set -g pane-border-style "fg=white bg=default"
set -g display-panes-active-colour red
set -g display-panes-colour blue
# remap prefix to Control + o
set -g prefix C-o
unbind C-b
bind C-o send-prefix
# force a reload of the config file
unbind r
bind r source-file ~/.tmux.conf
# copy mode
unbind p
bind p paste-buffer
bind -T copy-mode-vi 'v' send -X begin-selection
bind -T copy-mode-vi 'r' send -X rectangle-toggle
bind -T copy-mode-vi 'y' send -X copy-pipe "reattach-to-user-namespace pbcopy"
unbind -T copy-mode-vi Enter
bind-key -T copy-mode-vi Enter send -X copy-pipe "reattach-to-user-namespace pbcopy"
# quick pane cycling
unbind ^F
bind ^F select-pane -t :.+
# switch panes
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# select window with meta+number
bind -n M-0 select-window -t 0
bind -n M-1 select-window -t 1
bind -n M-2 select-window -t 2
bind -n M-3 select-window -t 3
bind -n M-4 select-window -t 4
bind -n M-5 select-window -t 5
bind -n M-6 select-window -t 6
bind -n M-7 select-window -t 7
bind -n M-8 select-window -t 8
bind -n M-9 select-window -t 9
# splits and windows
bind s split-window -v -c "#{pane_current_path}"
bind v split-window -h -c "#{pane_current_path}"
bind c new-window -c "#{pane_current_path}"
bind S choose-session
# Renumber windows sequentially after closing any of them
set -g renumber-windows on
# zoom
bind -n M-enter resize-pane -Z
bind -n M-space set -q status
# Copy/paste to system clipboard
bind C-c run "tmux save-buffer - | reattach-to-user-namespace pbcopy"
bind C-v run "reattach-to-user-namespace pbpaste | tmux load-buffer - && tmux paste-buffer"
set -g @prefix_highlight_bg 'colour33'
set -g @prefix_highlight_show_copy_mode 'on'
set -g @prefix_highlight_copy_mode_attr 'fg=colour234,bg=yellow,bold'
# # List of plugins
set -g @tpm_plugins ' \
tmux-plugins/tpm \
dbalatero/tmux-pain-control \
tmux-plugins/tmux-yank \
tmux-plugins/tmux-copycat \
tmux-plugins/tmux-open \
tmux-plugins/tmux-battery \
tmux-plugins/tmux-prefix-highlight \
nhdaly/tmux-better-mouse-mode \
robhurring/tmux-spotify \
'
set-env -g @pane_resize "20"
# Smart pane switching with awareness of vim splits
is_vim_emacs='echo "#{pane_current_command}" | \
grep -iqE "((^|\/)g?(view|n?vim?x?)(diff)?$)|emacs"'
# Move panes with ctrl+hjkl
bind -n 'C-h' if-shell "$is_vim_emacs" "send-keys C-h" "select-pane -L"
bind -n 'C-j' if-shell "$is_vim_emacs" "send-keys C-j" "select-pane -D"
bind -n 'C-k' if-shell "$is_vim_emacs" "send-keys C-k" "select-pane -U"
bind -n 'C-l' if-shell "$is_vim_emacs" "send-keys C-l" "select-pane -R"
# enable in copy mode key table
bind -Tcopy-mode-vi 'C-h' if-shell "$is_vim_emacs" "send-keys C-h" "select-pane -L"
bind -Tcopy-mode-vi 'C-j' if-shell "$is_vim_emacs" "send-keys C-j" "select-pane -D"
bind -Tcopy-mode-vi 'C-k' if-shell "$is_vim_emacs" "send-keys C-k" "select-pane -U"
bind -Tcopy-mode-vi 'C-l' if-shell "$is_vim_emacs" "send-keys C-l" "select-pane -R"
bind -Tcopy-mode-vi 'C-\' if-shell "$is_vim_emacs" "send-keys C-\\\\" "select-pane -l"
# Resize panes with meta+hjkl
bind -n M-h if-shell "$is_vim_emacs" "send-keys M-h" "resize-pane -L 10"
bind -n M-l if-shell "$is_vim_emacs" "send-keys M-l" "resize-pane -R 10"
bind -n M-k if-shell "$is_vim_emacs" "send-keys M-k" "resize-pane -U 5"
bind -n M-j if-shell "$is_vim_emacs" "send-keys M-j" "resize-pane -D 5"
run '~/.tmux/plugins/tpm/tpm'
# โญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
# โ Choose a theme: โ
# โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
# source ~/.tmux/classic_theme.conf
source ~/.tmux/electron_highlighter.conf