forked from holmes-py/tmux_config
-
Notifications
You must be signed in to change notification settings - Fork 1
/
holmes_tmux.conf
150 lines (107 loc) · 4.6 KB
/
holmes_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
#Change Bind Key to B
set -g prefix C-a
bind C-a send-prefix
unbind C-b
# Change this if you use Bash
set-option -g default-shell /usr/bin/zsh
# Set History
set -g history-limit 500000
# Prevent automatic renaming of tabs
set -g allow-rename off
# Use Vim keybindings
set-window-option -g mode-keys vi
# Status Bar Stuff ----------------------------------------------
set -g status-interval 3
set-option -g status-position top
set-option -g status-justify "left"
# Length of the status bar
set -g status-left-length 30
set -g status-right-length 150
# Default statusbar color
set-option -g status-style bg=colour39,fg=colour223
set-option -g status "on"
set-option -g status-left "\
#[fg=colour7, bg=colour241]#{?client_prefix,#[bg=colour167],} #S \
#[fg=colour241, bg=colour237]#{?client_prefix,#[fg=colour167],} #{?window_zoomed_flag, ,}"
# IMPORTANT: I am using 2 scripts to check if I am connected to the VPN and if sshuttle is working. You can change them if you don't need sshuttle.
set-option -g status-right "\
#[fg=colour237, bg=colour214] #(~/Scripts/sshuttle-chk.sh;) #(echo '|') #(~/Scripts/vpnIP_VM.sh) #(hostname) \
#[fg=colour246, bg=colour237] %b %d '%y\
#[fg=colour109] %l:%M %p \
#[fg=colour248, bg=colour239]"
set-window-option -g window-status-current-format "\
#[fg=colour237, bg=colour214]\
#[fg=colour239, bg=colour214] #I*\
#[fg=colour239, bg=colour214] #W \
#[fg=colour214, bg=colour237]"
set-window-option -g window-status-format "\
#[fg=colour237,bg=colour239,noitalics]\
#[fg=colour223,bg=colour239] #I\
#[fg=colour223, bg=colour239] #W"
# ---------------------------------------------------------------
# Switch betewen panes using alt + arrow
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D
# Use r to quickly reload tmux settings
unbind r
bind r \
source-file ~/.tmux.conf \;\
display 'Reloaded tmux config'
# Window settings
# Ensure window index numbers get reordered on delete.
set-option -g renumber-windows on
# Start windows and panes index at 1, not 0.
set -g base-index 1
setw -g pane-base-index 1
# Default window title colors
set-window-option -g window-status-style bg=cyan,fg=colour237
# Default window with an activity alert
set-window-option -g window-status-activity-style bg=cyan,fg=cyan
# Active window title colors
set-window-option -g window-status-current-style bg=green,fg=colour237
# Set active pane border color
set-option -g pane-active-border-style fg=colour39
#set-option -g pane-active-border-style fg=colour214
# Set inactive pane border color
set-option -g pane-border-style fg=colour239
# Message info
set-option -g message-style bg=colour239,fg=colour223 # bg=bg2, fg=fg1
# Writing commands inactive
set-option -g message-command-style bg=colour239,fg=colour223 # bg=fg3, fg=bg1
# Change Split Commands -- keeping current working directory
bind c new-window -c "#{pane_current_path}"
bind | split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"
# Uncomment to remove old bindings:
unbind '"'
unbind %
# Clipboard
# Send any copied information into the main clipboard using xclip
bind -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "xclip -i -f -selection primary | xclip -i -selection clipboard"
# Linux only
set -g mouse on
bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'select-pane -t=; copy-mode -e; send-keys -M'"
bind -n WheelDownPane select-pane -t= \; send-keys -M
bind -n C-WheelUpPane select-pane -t= \; copy-mode -e \; send-keys -M
bind -T copy-mode-vi C-WheelUpPane send-keys -X halfpage-up
bind -T copy-mode-vi C-WheelDownPane send-keys -X halfpage-down
bind -T copy-mode-emacs C-WheelUpPane send-keys -X halfpage-up
bind -T copy-mode-emacs C-WheelDownPane send-keys -X halfpage-down
# To copy, left click and drag to highlight text in yellow,
# once you release left click yellow text will disappear and will automatically be available in clibboard
# # Use vim keybindings in copy mode
setw -g mode-keys vi
# Update default binding of `Enter` to also use copy-pipe
unbind -T copy-mode-vi Enter
bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "xclip -selection c"
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "xclip -in -selection clipboard"
# Plugin Manager
# List of plugins.
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
set -g @continuum-boot 'on'
# Initialize TPM (keep this line at the very bottom of your tmux.conf).
run -b '~/.tmux/plugins/tpm/tpm'