-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tmux.conf
105 lines (81 loc) · 3.17 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
# Load plugins.
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'odedlaz/tmux-onedark-theme' # one dark theme
set -g @plugin 'tmux-plugins/tmux-yank' # Cross-platform support for clipboard.
set -g @plugin 'tmux-plugins/tmux-resurrect' # Save/Restore sessions
set -g @plugin 'tmux-plugins/tmux-continuum' # Auto Save/Restore
# Use Ctrl+A as the prefix key
set -g prefix C-a
unbind C-b
bind C-a send-prefix
# Restore using continuum
set -g @continuum-restore 'on'
set -g update-environment "DISPLAY SSH_ASKPASS SSH_AGENT_PID SSH_CONNECTION WINDOWID XAUTHORITY"
set-environment -g 'SSH_AUTH_SOCK' ~/.ssh/ssh_auth_sock
# Enable scroll, resize panes, select splits and windows by mouse
set -g mouse on
# Toggle mouse on with C-A m
bind m \
set -g mouse on \;\
display 'Mouse: ON'
# Toggle mouse off with C-A M for selecting normaly
bind M \
set -g mouse off \;\
display 'Mouse: OFF'
# Scroll History
set -g history-limit 10000
# Set first window to index 1 (not 0) to map more to the keyboard layout...
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
# Copy and paste like in vim
bind -T copy-mode-vi v send -X begin-selection
bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "pbcopy"
bind P paste-buffer
bind -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "pbcopy"
# Reload tmux.conf on prexif+r
bind r source-file ~/.tmux.conf \; display "Reloaded!"
# Use 256 colours.
set-option -ga terminal-overrides ",xterm-256color:Tc"
set-option -g default-terminal "screen-256color"
set -g @onedark_widgets "#(date +%s)"
set -g @onedark_date_format "%d/%m/%y"
# 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
# Set the name of the window initially, but then don't let tmux change it.
# The name can still be set at any time with Ctrl+B + ,
set-option -g allow-rename off
# Enable visual alerts for windows. Hide bells/silence.
set-window-option -g monitor-activity off # highlight active windows?
set-option -g visual-activity off # show a message on window activity?
set-option -g visual-silence off
set-option -g visual-bell off
set-option -g bell-action none
# Don't wait for an escape sequence after hitting
# Esc. fixes insert mode exit lag in vim.
set -sg escape-time 0
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'