-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy path.tmux.conf
123 lines (98 loc) · 3.35 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
set -g prefix C-b
# Ctrl-B twice: Alternate between windows
bind C-b last-window
# Ctrl-B R: Reload tmux config
bind-key R source-file ~/.tmux.conf \; display "Reloaded .tmux.conf"
# Basic options
set -sg escape-time 0
set -g base-index 1
set -g history-limit 100000
set -g mouse on
set -g repeat-time 1000
# Terminal inside tmux must always be "{screen,tmux}[-256color]".
set -g default-terminal "tmux-256color"
# If the *outer* terminal is 256color, enable true color inside tmux.
set -ga terminal-overrides ",*-256color*:Tc"
set -g default-shell /bin/zsh
set -g update-environment "DISPLAY SSH_ASKPASS SSH_AUTH_SOCK SSH_AGENT_PID SSH_CONNECTION WINDOWID XAUTHORITY BACKGROUND"
set -g renumber-windows on
set -g focus-events on
set -g status-keys emacs
set -wg mode-keys vi
set -wg pane-base-index 1
# Don't exit server when there are no sessions.
set -g exit-empty off
set -g exit-unattached off
# Nicer copy mode:
#
# Enter Copy to OSX clipboard
# y Copy
# v Start selection
unbind -T copy-mode-vi Enter
unbind -T copy-mode-vi Space
# Use alt-space for copy mode.
unbind -T prefix [
bind -n M-Space copy-mode
# Modify the system clipboard.
set -g set-clipboard on
bind-key -T copy-mode-vi Enter send -X copy-selection-and-cancel
bind-key -T copy-mode-vi y send -X copy-selection-no-clear
bind-key -T copy-mode-vi v send -X begin-selection
# Avoid accidentally suspending client instead of full screen.
unbind C-z
# Resize to smaller only if a smaller client is actually looking at the
# window.
set -wg aggressive-resize on
# Window splitting:
#
# [hold Ctrl] B \ Vertical split
# [hold Ctrl] B - Horizontal split
unbind %
unbind '"'
bind-key c new-window
bind-key C-\\ split-window -h -c "#{pane_current_path}"
bind-key C-_ split-window -v -c "#{pane_current_path}"
bind-key C-- split-window -v -c "#{pane_current_path}"
# Moving between panes: If we're inside vim, send the same keys to vim,
# otherwise move between tmux splits.
#
# See: /~https://github.com/christoomey/vim-tmux-navigator
#
# Because we take over Ctrl-L, Ctrl-B Ctrl-L is used to send Ctrl-L.
is_vim='echo "#{pane_current_command}" | grep -iqE "(^|\/)(tig|g?(view|n?vim?)(diff)?)$"'
bind -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
bind -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
bind -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U"
bind -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R"
bind C-l send-keys 'C-l'
# Resizing panes
bind-key -r C-j resize-pane -D 10
bind-key -r C-k resize-pane -U 10
bind-key -r C-h resize-pane -L 10
bind-key -r C-l resize-pane -R 10
# Break out/combine
unbind !
bind-key < break-pane
bind-key > choose-tree 'join-pane -s %%'
bind-key ^ choose-tree
# Unused
unbind Down
unbind Up
unbind Left
unbind Right
# Colors and styling
source-file ~/.tmux-molokai.conf
set -g status "on"
# Different background for non-active panes
set -wg window-style 'bg=#181818'
set -wg window-active-style 'bg=black'
# continuum configuration
set -g @continuum-restore 'on'
# tmux-fastcopy
bind-key f run-shell -b tmux-fastcopy
set -g @fastcopy-action 'clip set'
set -g @fastcopy-shift-action "~/.tmux/select.sh {}"
set -g @fastcopy-regex-url "https?:\\/\\/[-\\w@:%.\\+~#=]{1,256}\\.[\\w()]{1,6}\\b(?:[-\\w()@:%\\+.~#?&//=]*)"
# Plugins
run ~/.tmux/plugins/tmux-resurrect/resurrect.tmux
run ~/.tmux/plugins/tmux-continuum/continuum.tmux