-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path.tmux.conf
136 lines (102 loc) · 4.38 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
# _ __
# | |_ _ __ ___ _ ___ __ ___ ___ _ __ / _|
# | __| '_ ` _ \| | | \ \/ / / __/ _ \| '_ \| |_
# | |_| | | | | | |_| |> < | (_| (_) | | | | _|
#(_)__|_| |_| |_|\__,_/_/\_(_)___\___/|_| |_|_|
# Good Reference: https://wiki.archlinux.org/index.php/Tmux#Bash
# Tmux-sensible: https://github.com/tmux-plugins/tmux-sensible
# Use vim keybindings in copy mode
setw -g mode-keys vi
# Use emacs key bindings in tmux command prompt (prefix + :)
set -g status-keys emacs
# Setup 'v' to begin selection as in Vim
bind-key -t vi-copy v begin-selection
bind-key -t vi-copy y copy-pipe "reattach-to-user-namespace pbcopy"
# Update default binding of `Enter` to also use copy-pipe
unbind -t vi-copy Enter
bind-key -t vi-copy Enter copy-pipe "reattach-to-user-namespace pbcopy"
set-option -ga terminal-override ',rxvt-uni*:XT:Ms=\E]52;%p1%s;%p2%s\007'
bind r source-file ~/.tmux.conf \; display "Reloaded!" #reload w ctrl-r
set -g prefix C-a #prefix from ctrl-b to ctrl-a
unbind C-b #allow for other things
set -sg escape-time 0 #quicker responses in vim
bind C-a send-prefix #pass on ctrl-a for other apps
set -g base-index 1 # start indexing on 1, since 0 is on the other side of the keyboard
setw -g pane-base-index 1 # start indexing on 1, since 0 is on the other side of the keyboard
bind 0 select-window -t :10 # make prefix 0 go to 10
set -g renumber-windows on # renumber windows when one is closed
set -g history-limit 10000 # remember more
if-shell "[[ `tmux -V | cut -d' ' -f2` -ge 2.1 ]]" "setw -g mouse off" # pass mouse to terminal emulator (don't let tmux play w the mouse)
bind v split-window -h
bind b split-window -v
#bind ] select-pane -t :.+
bind LEFT resize-p -L 4
bind RIGHT resize-p -R 4
bind UP resize-p -U 4
bind DOWN resize-p -D 4
# Reload the file with Prefix r
# START:reload
bind r source-file ~/.tmux.conf \; display "Reloaded!"
# END:reload
set-window-option -g mode-keys vi
#Resizing
bind-key h select-pane -L
bind-key j select-pane -D
bind-key k select-pane -U
bind-key l select-pane -R
#set status bar
set -g status-bg black
set -g status-fg white
set -g status-left '#[fg=white]#H'
# Highlight active window
set-window-option -g window-status-current-bg red
set-window-option -g window-status-current-fg black
# blue colour63
# tmux colors: https://i.stack.imgur.com/e63et.png
# Set status left to display loads
# set -g status-left '#[fg=white]#(uptime | cut -d "," -f 2-)'
set -g status-left-length 30
set -g status-left '#[fg=colour27][#S] #[fg=colour53]>> '
set -g status-justify left
# Set right side window status bar to hostname and ip address
# First ip number is my ip address, second is the internet router's ip address
# Right side of status bar
# $(echo $USER) - shows the current username
# #H - shows the hostname of your computer
# %h %d %Y - date in the [Mon DD YYYY] format
# %l:%M %p - time in the [HH:MM AM/PM] format
# Source for battery: https://github.com/Goles/Battery/blob/master/battery
set -g status-right-length 250
set -g status-right "#(battery -t) #[fg=red] %A #[fg=blue] %h %d %Y #[fg=blue] #[fg=cyan,bold]%l:%M %p"
#[fg=brightblue]#(ifconfig en0 | grep 'inet ' | awk '{print \"en0 \" $2}')#(ifconfig en1 | grep 'inet ' | awk '{print \"en1 \" $2}')#[fg=red]#(ifconfig tun0 | grep 'inet ' | awk '{print \"vpn \" $2}')"
# Automatically set window title
setw -g automatic-rename on
#Set pane colors
set-option -g pane-border-fg colour241
set-option -g pane-active-border-fg colour160
#C-a C-a for last window
bind-key C-a last-window
set -g terminal-overrides 'xterm*:smcup@:rmcup@'
set -g default-command "reattach-to-user-namespace -l /usr/local/bin/bash"
set -g default-terminal "screen-256color"
# useful for "grouped sessions" and multi-monitor setup
setw -g aggressive-resize on
# TPM - Tmux Plugin Manager Settings
# Press prefix + I to install
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-resurrect'
# save vim contents using status
set -g @resurrect-strategy-vim 'session'
# save pane contents
set -g @resurrect-capture-pane-contents 'on'
# remap save/restore bindings
set -g @resurrect-save 'q'
set -g @resurrect-restore 'e'
# save automatically
set -g @plugin 'tmux-plugins/tmux-continuum'
# store on boot
set -g @continuum-restore 'on'
set -g @continuum-save-interval '15'
# Initialize the plugin manager (must be at bottom)
run '~/.tmux/plugins/tpm/tpm'