forked from dcwangmit01/yadm-dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy path.tmux.conf
102 lines (80 loc) · 3.78 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
# Set the terminal type so colors get rendered correctly
set -g default-terminal "screen-256color"
# window numbering
# start window numbers at 1 to match keyboard order with tmux window order
set -g base-index 1
set-window-option -g pane-base-index 1
set -g renumber-windows on
# increase scrollback lines
set -g history-limit 10000
# Mouse Mode
#set-option -g mouse on
# split panes using | and -
bind | split-window -h
bind - split-window -v
unbind '"'
unbind %
# pane navigation
bind -r h select-pane -L # move left
bind -r j select-pane -D # move down
bind -r k select-pane -U # move up
bind -r l select-pane -R # move right
bind > swap-pane -D # swap current pane with the next one
bind < swap-pane -U # swap current pane with the previous one
# pane resizing
bind -r H resize-pane -L 2
bind -r J resize-pane -D 2
bind -r K resize-pane -U 2
bind -r L resize-pane -R 2
# reload config file (change file location to your the tmux.conf you want to use)
bind r source-file ~/.tmux.conf
# set terminal title
set -g set-titles on
set -g set-titles-string '#h ❐ #S ● #I #W'
# set window title to be last 3 segments of path (change to -f-3 vs -f-1)
# highlight active window
# variation of: https://stackoverflow.com/questions/28376611/how-to-automatically-rename-tmux-windows-to-the-current-directory
set-window-option -g window-status-current-format '#[fg=red,bg=colour166,bold] #{window_index} #[fg=green]#{pane_current_command} #[fg=cyan]#(echo "#{pane_current_path}" | rev | cut -d'/' -f-1 | rev) #[fg=white]|'
set-window-option -g window-status-format '#[fg=white,bold]#{window_index} #[fg=green]#{pane_current_command} #[fg=blue]#(echo "#{pane_current_path}" | rev | cut -d'/' -f-1 | rev) #[fg=white]|'
###############################################################################
# Solarized (cut and pasted)
# https://github.com/seebi/tmux-colors-solarized/blob/master/tmuxcolors-256.conf
#### COLOUR (Solarized 256)
# default statusbar colors
set-option -g status-style fg=colour136,bg=colour235 #yellow and base02
# default window title colors
set-window-option -g window-status-style fg=colour244,bg=default #base0 and default
#set-window-option -g window-status-style dim
# active window title colors
set-window-option -g window-status-current-style fg=colour166,bg=default #orange and default
#set-window-option -g window-status-current-style bright
# pane border
set-option -g pane-border-style fg=colour235 #base02
set-option -g pane-active-border-style fg=colour240 #base01
# message text
set-option -g message-style fg=colour166,bg=colour235 #orange and base02
# pane number display
set-option -g display-panes-active-colour colour33 #blue
set-option -g display-panes-colour colour166 #orange
# clock
set-window-option -g clock-mode-colour colour64 #green
# bell
set-window-option -g window-status-bell-style fg=colour235,bg=colour160 #base02, red
# SSH agent forwarding
#
# Ensure that SSH-Agent forwarding will work when re-attaching to the tmux
# session from a different SSH connection (after a dropped connection).
# This code will run upon tmux create, tmux attach, or config reload.
#
# If there is an SSH_AUTH_SOCK originally defined:
# 1) Remove all SSH related env var names from update-enviroment.
# Without this, setenv cannot override variables such as SSH_AUTH_SOCK.
# Verify update-environment with: tmux show-option -g update-environment
# 2) Force-set SSH_AUTH_SOCK to be a known location
# /tmp/ssh_auth_sock_tmux
# 3) Force-create a link of the first found ssh-agent socket at the known location
if-shell '[ -n $SSH_AUTH_SOCK ]' " \
set-option -sg update-environment \"DISPLAY WINDOWID XAUTHORITY\"; \
setenv -g SSH_AUTH_SOCK /tmp/ssh_auth_sock_tmux; \
run-shell \"ln -sf $(find /tmp/ssh-* -type s -readable | head -n 1) /tmp/ssh_auth_sock_tmux\" \
"