-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.tmux.conf
146 lines (114 loc) · 4.29 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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# tmux Global
#############
# Set zsh as default shell
set-option -g default-shell /bin/zsh
# Override prefix
unbind C-b
set -g prefix C-a
# Global keybindings
bind r source-file ~/.tmux.conf \; display "~/.tmux.conf reloaded!" # force a reload of the config file
unbind C-z # don't suspend client
# Incrase scrollback
set -g history-limit 10000
# Use vim keybindings in copy mode
setw -g mode-keys vi
# Enable mouse mode
set -g mouse on
# Session / Window / Pane Management
####################################
# session navigation
bind j split-window -v "tmux list-sessions | sed -E 's/:.*$//' | grep -v \"^$(tmux display-message -p '#S')\$\" | fzf --reverse | xargs tmux switch-client -t"
# start window and pane indexes at 1
set -g base-index 1
set -g pane-base-index 1
set -g renumber-windows on
# Easily swap a pane (targeted by pane number) with the current pane
bind-key s display-panes\; command-prompt -p "pane #: " "swap-pane -t '%%'"
# break pane to a new window
bind b break-pane -d
# pane splitting, open all in current path
bind - split-window -v -c "#{pane_current_path}"
bind \\ split-window -h -c "#{pane_current_path}"
bind c new-window -c "#{pane_current_path}"
# pane navigation
bind -n C-h select-pane -L
bind -n C-j select-pane -D
bind -n C-k select-pane -U
bind -n C-l select-pane -R
# pane resizing
bind -n S-Left resize-pane -L 2
bind -n S-Right resize-pane -R 2
bind -n S-Down resize-pane -D 1
bind -n S-Up resize-pane -U 1
bind -n C-Left resize-pane -L 10
bind -n C-Right resize-pane -R 10
bind -n C-Down resize-pane -D 5
bind -n C-Up resize-pane -U 5
# Nested tmux
#############
# Extra variables
color_status_text="colour245"
color_window_off_status_bg="colour238"
color_light="white" #colour015
color_dark="colour232" # black= colour232
color_window_off_status_current_bg="colour254"
wg_is_keys_off="#[fg=$color_light,bg=$color_window_off_indicator]#([ $(tmux show-option -qv key-table) = 'off' ] && echo 'OFF')"
# Override local config
bind -T root F12 \
set -g status-position top \;\
set prefix None \;\
set key-table off \;\
set window-status-current-format "#[fg=colour8,bg=colour0,nobold,nounderscore,noitalics]#[fg=colour4,bg=colour8] $wg_is_keys_off #[fg=colour8,bg=colour0,nobold,nounderscore,noitalics]" \;\
set window-status-current-style "fg=$color_dark,bold,bg=$color_window_off_status_current_bg" \;\
if -F '#{pane_in_mode}' 'send-keys -X cancel' \;\
refresh-client -S \;\
# Reset to defaults when
bind -T off F12 \
set -g status-position bottom \;\
set -u prefix \;\
set -u key-table \;\
set -u window-status-current-style \;\
set -u window-status-current-format \;\
refresh-client -S
# Status Bar
############
source-file ~/.dotfiles/.tmux/statusbar
set -g @prefix_highlight_empty_prompt ' '
set -g @prefix_highlight_empty_attr 'fg=colour0,bg=colour0'
set -g @prefix_highlight_fg 'colour4'
set -g @prefix_highlight_bg 'colour0'
# Plugins
#########
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-prefix-highlight'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
set -g @plugin 'christoomey/vim-tmux-navigator'
set -g @plugin 'xamut/tmux-weather'
# Plugin configuration
## tmux-continuum
set -g @continuum-restore 'on'
## tmux-resurrect - using vim's tpope/vim-obsession
set -g @resurrect-capture-pane-contents 'on'
set -g @resurrect-strategy-vim 'session'
set -g @resurrect-processes 'gitsh'
## tmux-weather
set-option -g @tmux-weather-interval 5
set-option -g @tmux-weather-location "Seattle"
set-option -g @tmux-weather-units "u"
set-option -g @tmux-weather-format 3
# SSH Configuration
# Remove SSH_AUTH_SOCK to disable tmux automatically resetting the variable
set -g update-environment "DISPLAY SSH_ASKPASS SSH_AGENT_PID \
SSH_CONNECTION WINDOWID XAUTHORITY"
# Use a symlink to look up SSH authentication
setenv -g SSH_AUTH_SOCK $HOME/.ssh/ssh_auth_sock
# Local overrides
source-file ~/.dotfiles/.tmux.conf.local
# install tpm if it's not already there
if "test ! -d ~/.tmux/plugins/tpm" \
"run 'git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm && ~/.tmux/plugins/tpm/bin/install_plugins'"
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'