-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tmux.conf
162 lines (116 loc) · 5.08 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
154
155
156
157
158
159
160
161
162
# : << EOF
# https://github.com/gpakosz/.tmux
# (‑●‑●)> dual licensed under the WTFPL v2 license and the MIT license,
# without any warranty.
# Copyright 2012— Gregory Pakosz (@gpakosz).
# /!\ do not edit this file
# instead, override settings in ~/.tmux.conf.local, see README.md
# -- plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'erikw/tmux-powerline'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set-option -g mouse on
set-option -g status on
set-option -g status-interval 2
set-option -g status-justify "centre"
set-option -g status-left-length 60
set-option -g status-right-length 90
# -- general -------------------------------------------------------------------
set -g default-terminal "screen-256color"
if 'infocmp -x tmux-256color > /dev/null 2>&1' 'set -g default-terminal "tmux-256color"'
set-option -g pane-active-border-style bg=colour214
set-option -g set-clipboard on
setw -g xterm-keys on
set -s escape-time 0 # faster command sequences
set -sg repeat-time 0 # increase repeat timeout
set -s focus-events on
set -q -g status-utf8 on # expect UTF-8 (tmux < 2.2)
setw -q -g utf8 on
set-option -g status-position top
set -g history-limit 5000 # boost history
# edit configuration
bind e new-window -n "~/.tmux.conf.local" sh -c '${EDITOR:-vim} ~/.tmux.conf.local && tmux source ~/.tmux.conf && tmux display "~/.tmux.conf sourced"'
# reload configuration
bind r source-file ~/.tmux.conf \; display '~/.tmux.conf sourced'
set -g base-index 1 # start windows numbering at 1
setw -g pane-base-index 1 # make pane numbering consistent with windows
setw -g automatic-rename on # rename window to reflect current program
set -g renumber-windows on # renumber windows when a window is closed
set -g set-titles on # set terminal title
set -g display-panes-time 800 # slightly longer pane indicators display time
set -g display-time 1000 # slightly longer status messages display time
set -g status-interval 10 # redraw status line every 10 seconds
# clear both screen and history
bind -n C-l send-keys C-l \; run 'sleep 0.2' \; clear-history
# activity
set -g monitor-activity on
set -g visual-activity off
# vi keybindings
setw -g mode-keys vi
bind-key -T copy-mode-vi 'v' send -X begin-selection
bind-key -T copy-mode-vi 'C-v' send -X rectangle-toggle
bind-key -T copy-mode-vi 'y' send -X copy-selection
# create session
bind C-c new-session
bind -n M-c new-window
bind -n M-Q kill-window
# find session
bind C-f command-prompt -p find-session 'switch-client -t %%'
# session navigation
bind BTab switch-client -l # move to last session
# split current window horizontally
bind -n M-] split-window -v -c "#{pane_current_path}"
# split current window vertically
bind -n M-[ split-window -h -c "#{pane_current_path}"
# kill pane
bind -n M-q kill-pane
# pane navigation
bind -r h select-pane -L # move left
bind -r j select-pane -D # move down
bind -r k select-pane -U # move up
bind -r l select-pane -R # move right
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D
# copy-mode binding
bind -n M-\\ copy-mode
bind -n M-f resize-pane -Z
bind -n M-S-. swap-pane -D
bind -n M-S-, swap-pane -U
# maximize current pane
bind + run 'cut -c3- ~/.tmux.conf | sh -s _maximize_pane "#{session_name}" #D'
# pane resizing
bind -r H resize-pane -L 2
bind -r J resize-pane -D 2
bind -r K resize-pane -U 2
bind -r L resize-pane -R 2
# window navigation
#unbind n
#unbind p
#bind -r C-h previous-window # select previous window
#bind -r C-l next-window # select next window
#bind Tab last-window # move to last active window
# toggle mouse
bind m run "cut -c3- ~/.tmux.conf | sh -s _toggle_mouse"
bind U run "cut -c3- ~/.tmux.conf | sh -s _urlview #{pane_id}"
bind F run "cut -c3- ~/.tmux.conf | sh -s _fpp #{pane_id} #{pane_current_path}"
bind b list-buffers # list paste buffers
#bind p paste-buffer # paste from the top paste buffer
bind P choose-buffer # choose which buffer to paste from
# -- 8< ------------------------------------------------------------------------
source -q ~/.tmux.conf.local
run 'cut -c3- ~/.tmux.conf | sh -s _apply_configuration'
# Switch windows alt+number
bind-key -n M-1 if-shell 'tmux select-window -t 1' '' 'new-window -t 1 -c $HOME'
bind-key -n M-2 if-shell 'tmux select-window -t 2' '' 'new-window -t 2 -c $HOME'
bind-key -n M-3 if-shell 'tmux select-window -t 3' '' 'new-window -t 3 -c $HOME'
bind-key -n M-4 if-shell 'tmux select-window -t 4' '' 'new-window -t 4 -c $HOME'
bind-key -n M-5 if-shell 'tmux select-window -t 5' '' 'new-window -t 5 -c $HOME'
bind-key -n M-6 if-shell 'tmux select-window -t 6' '' 'new-window -t 6 -c $HOME'
bind-key -n M-7 if-shell 'tmux select-window -t 7' '' 'new-window -t 7 -c $HOME'
bind-key -n M-8 if-shell 'tmux select-window -t 8' '' 'new-window -t 8 -c $HOME'
bind-key -n M-9 if-shell 'tmux select-window -t 9' '' 'new-window -t 9 -c $HOME'
run '~/.tmux/plugins/tpm/tpm'