-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.tmux.conf
129 lines (108 loc) · 4.21 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
# Custom
bind-key -n C-d detach
# -- plugins -------------------------------------------------------------------
# If TPM is not install run this: git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
set -g @plugin 'tmux-plugins/tmux-yank'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'
# -- navigation ----------------------------------------------------------------
# create session
bind C-c new-session
# find session
bind C-f command-prompt -p find-session 'switch-client -t %%'
# split current window horizontally
bind - split-window -v
# split current window vertically
bind \ split-window -h
# 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 > swap-pane -D # swap current pane with the next one
bind < swap-pane -U # swap current pane with the previous one
# smart pane switching with awareness of vim splits
bind -n C-h run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim$' && tmux send-keys C-h) || tmux select-pane -L"
bind -n C-j run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim$' && tmux send-keys C-j) || tmux select-pane -D"
bind -n C-k run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim$' && tmux send-keys C-k) || tmux select-pane -U"
bind -n C-l run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim$' && tmux send-keys C-l) || tmux select-pane -R"
bind -n C-\ run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim$' && tmux send-keys 'C-\\') || tmux select-pane -l"
bind C-l send-keys 'C-l'
# 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
# refresh tmux
bind r source-file ~/.tmux.conf
set -g default-terminal "screen-256color" # colors!
# -- display -------------------------------------------------------------------
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
# prefix C-b
# prefix2 None
# remap prefix from 'C-b' to 'C-a'
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
set-option -g mouse on
# make scrolling with wheels work
bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'select-pane -t=; copy-mode -e; send-keys -M'"
bind -n WheelDownPane select-pane -t= \; send-keys -M
# Clipboard
set-option -s set-clipboard on
# activity-action other
# assume-paste-time 1
# base-index 0
# bell-action any
# default-command ""
# default-shell "/bin/zsh"
# destroy-unattached off
# detach-on-destroy on
# display-panes-active-colour red
# display-panes-colour blue
# display-panes-time 1000
# display-time 750
# history-limit 2000
# key-table "root"
# lock-after-time 0
# lock-command "lock -np"
# message-command-style fg=yellow,bg=black
# message-style fg=black,bg=yellow
# mouse off
# renumber-windows off
# repeat-time 500
# set-titles off
# set-titles-string "#S:#I:#W - \"#T\" #{session_alerts}"
# silence-action other
# status on
# status-interval 15
# status-justify left
# status-keys vi
# status-left "[#S] "
# status-left-length 10
# status-left-style default
# status-position bottom
# status-right " \"#{=21:pane_title}\" %H:%M %d-%b-%y"
# status-right-length 40
# status-right-style default
# status-style fg=black,bg=green
# update-environment[0] "DISPLAY"
# update-environment[1] "SSH_ASKPASS"
# update-environment[2] "SSH_AUTH_SOCK"
# update-environment[3] "SSH_AGENT_PID"
# update-environment[4] "SSH_CONNECTION"
# update-environment[5] "WINDOWID"
# update-environment[6] "XAUTHORITY"
# visual-activity off
# visual-bell off
# visual-silence off
# word-separators " -_@"