-
Notifications
You must be signed in to change notification settings - Fork 0
/
dot_tmux.conf
152 lines (116 loc) · 4.95 KB
/
dot_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
# --------#
# General #
# --------#
# Default shell
set -g default-shell $SHELL
set -g default-terminal "screen-256color" # colors!
# Undercurl for errors in vim etc
set -as terminal-overrides ',*:Smulx=\E[4::%p1%dm' # undercurl support
set -as terminal-overrides ',*:Setulc=\E[58::2::%p1%{65536}%/%d::%p1%{256}%/%{255}%&%d::%p1%{255}%&%d%;m' # underscore colours - needs tmux-3.0
# Mouse
set -g mouse on
# History
set -g history-limit 102400
# Set windows and page index to base 1
set -g base-index 1
setw -g pane-base-index 1
# Re-number windows when creating/closing new windows
set -g renumber-windows on
# Use emacs key bindings in status line
set-option -g status-keys emacs
# Use vim key bindings in copy mode
setw -g mode-keys vi
# Fix ESC delay in vim
set -g escape-time 0
# ------------#
# Keybindings #
# ------------#
# Set prefix
unbind C-Space
set -g prefix C-Space
# Send command on double press
bind C-Space send-prefix
# bind C-l send-keys 'C-l'
unbind m
bind m set -g mouse on
# Copy-mode
unbind-key -T copy-mode-vi v
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi 'C-v' send-keys -X rectangle-toggle
bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "pbcopy"
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "pbcopy"
# Reload tmux.conf on prefix r
bind r source-file ~/.tmux.conf \; display "Config reloaded!"
# Split panes and remember current path
bind v split-window -h -c '#{pane_current_path}'
bind s split-window -v -c '#{pane_current_path}'
# Remember current path when creating new windows
bind c new-window #-c '#{pane_current_path}'
# Prefix+s shows session list by default, but is shadowed by my split screen
# biding, so use a instead
bind a choose-tree -s
bind 'h' select-pane -L
bind 'j' select-pane -D
bind 'k' select-pane -U
bind 'l' select-pane -R
bind 'C-h' select-pane -L
bind 'C-j' select-pane -D
bind 'C-k' select-pane -U
bind 'C-l' select-pane -R
bind ']' next-window
bind '[' previous-window
bind 'C-f' command-prompt -I "#W" "rename-window -- '%%'"
bind ',' display-popup -E "fish -c tmuz-switch-session"
bind '?' display-popup -h 90% -w 90% -E "fish -c tmuz-list-keys"
# Toggle status bar
bind-key -r t set-option -g status
# Break pane into new window and keep focus on the current window
bind b break-pane -d
# # Smart pane switching with awareness of Vim splits.
# is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
# | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
# bind-key h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
# bind-key j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
# bind-key k if-shell "$is_vim" "send-keys C-k" "select-pane -U"
# bind-key l if-shell "$is_vim" "send-keys C-l" "select-pane -R"
# bind-key C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
# bind-key C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
# bind-key C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U"
# bind-key C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R"
# bind-key -T copy-mode-vi C-h select-pane -L
# bind-key -T copy-mode-vi C-j select-pane -D
# bind-key -T copy-mode-vi C-k select-pane -U
# bind-key -T copy-mode-vi C-l select-pane -R
# bind-key -T copy-mode-vi 'C-\' select-pane -l
# -----------#
# Status bar #
# -----------#
set -g status-position top
# source-file ~/.dotfiles/github_dark.tmux
# set-option -g status-justify left
# set-option -g status-left '#[bg=colour72] #[bg=colour237] #[bg=colour236] #[bg=colour235]#[fg=colour185] #S #[bg=colour236] '
# set-option -g status-left-length 16
# set-option -g status-bg colour237
# set-option -g status-right '#[bg=colour236] #[bg=colour235]#[fg=colour185] %a %R #[bg=colour236]#[fg=colour3] #[bg=colour237] #[bg=colour72] #[]'
# set-option -g status-interval 60
# set-option -g pane-active-border-style fg=colour246
# set-option -g pane-border-style fg=colour238
# set-window-option -g window-status-format '#[bg=colour238]#[fg=colour107] #I #[bg=colour240]#W#[bg=colour239]#[fg=colour195]#F#[bg=colour238] '
# set-window-option -g window-status-current-format '#[bg=colour236]#[fg=colour215] #I #[bg=colour234]#W#[bg=colour235]#[fg=colour195]#F#[bg=colour236] '
# # pane borders colours:
# tmux_conf_theme_pane_border='#006bbb' # light blue
# tmux_conf_theme_pane_active_border='#006bbb' # light blue
##################################
# TMUX Plugins Manager
# https://github.com/tmux-plugins/tpm.git
set-environment -g TMUX_PLUGIN_MANAGER_PATH '~/.tmux/plugins/'
# See this for the following notation: https://github.com/tmux-plugins/tpm/issues/127
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-resurrect'
# set -g @plugin 'tmux-plugins/tmux-sensible'
# Install TPM if it's missing
if "test ! -d ~/.tmux/plugins/tpm" \
"run 'git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm'"
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run -b '~/.tmux/plugins/tpm/tpm'