-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.tmux.conf
111 lines (89 loc) · 3.26 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
# set-option -g default-command "reattach-to-user-namespace -l zsh"
set -g update-environment "DISPLAY SSH_ASKPASS SSH_AGENT_PID SSH_CONNECTION WINDOWID XAUTHORITY"
set-option -g default-shell $SHELL
# Enable scroll, resize panes, select splits and windows by mouse
# set -g mode-mouse on
# set -g mouse-resize-pane on
# set -g mouse-select-pane on
# set -g mouse-select-window on
if-shell "if [[ `tmux -V | cut -d' ' -f2` -lt 2.1 ]]; then true; else false; fi" \
'set -g mode-mouse on; set -g mouse-resize-pane on; set -g mouse-select-pane on; set -g mouse-select-window on'
set-option -g mouse on
# Toggle mouse on with C-B m
bind m \
set -g mode-mouse on \;\
set -g mouse-resize-pane on \;\
set -g mouse-select-pane on \;\
set -g mouse-select-window on \;\
display 'Mouse: ON'
# Toggle mouse off with C-B M for selecting normaly
bind M \
set -g mode-mouse off \;\
set -g mouse-resize-pane off \;\
set -g mouse-select-pane off \;\
set -g mouse-select-window off \;\
display 'Mouse: OFF'
# Scroll History
set -g history-limit 10000
# Set first window index to 1 (not 0) for better switching from keyboard
set -g base-index 1
setw -g pane-base-index 1
# Set ability to capture on start and restore on exit window data when running an application
setw -g alternate-screen on
# Lower escape timing from 500ms to 50ms for quicker response to scroll-buffer access.
set -s escape-time 50
# act like vim
setw -g mode-keys vi
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# Manage window size
bind -r H resize-pane -L 5
bind -r J resize-pane -D 5
bind -r K resize-pane -U 5
bind -r L resize-pane -R 5
bind-key -r C-h select-window -t :-
bind-key -r C-l select-window -t :+
# Open new panes in current directory
bind c new-window -c "#{pane_current_path}"
bind '"' split-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
# Copy and paste like in vim
unbind [
bind Escape copy-mode
# bind -t vi-copy 'v' begin-selection
# bind -t vi-copy 'y' copy-selection
bind-key -t vi-copy v begin-selection
bind-key -t vi-copy y copy-pipe "reattach-to-user-namespace pbcopy"
# Update default binding of `Enter` to also use copy-pipe
unbind -t vi-copy Enter
bind-key -t vi-copy Enter copy-pipe "reattach-to-user-namespace pbcopy"
# Reload tmux.conf on prexif+r
bind r source-file ~/.tmux.conf \; display "Reloaded!"
# If you really need to send PREFIX combination somewhere then use c-j
bind C-j send-prefix
# Colors
set -g status-fg white
set -g status-bg black
setw -g window-status-fg cyan
setw -g window-status-bg default
setw -g window-status-attr dim
setw -g window-status-current-fg white
setw -g window-status-current-bg green
setw -g window-status-current-attr bright
set -g message-fg white
set -g message-bg black
set -g message-attr bright
set -g status-justify centre
# React on window activity
setw -g monitor-activity on
set -g visual-activity on
# Make prefix + u maximize pane and prefix + i restore everything back, work shitty if you change window after
# pressing Down
unbind Up
unbind Down
bind Up new-window -d -n tmp \; swap-pane -s tmp.1 \; select-window -t tmp
bind Down last-window \; swap-pane -s tmp.1 \; kill-window -t tmp
# Do not rename window titles automatically
set-window-option -g automatic-rename off