-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.tmux.conf
93 lines (79 loc) · 4.31 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
# Set the prefix as Ctrl-Space.
unbind C-b
unbind C-Space
set-option -g prefix C-Space
bind-key C-Space send-prefix
bind C-Space last-window
set -g status-style "fg=#665c54"
set -g status-left-style "fg=#928374"
# Options
set -g default-shell /bin/bash
set -g mode-keys vi
set -g status-keys vi
set -g base-index 1
setw -g pane-base-index 1
set -sg escape-time 0
set -g status-position top
set -g history-limit 25000
setw -g monitor-activity on
setw -g visual-activity off
set -g detach-on-destroy off # don't exit from tmux when closing a session
set-option -g status-justify left
set -g status-left-length 20
set-option -g status-left " #{?client_prefix,#[fg=color255],#[fg=color214]} 🐂 #S "
set -g status-right "#[align=absolute-centre] #[fg=colour103] Something useful #[align=right]"
set -ga status-right "#{?window_bigger,[#{window_offset_x}#,#{window_offset_y}] ,}\ #[fg=colour103] I use Arch BTW "
set -g status-right-length 65
#set-option -g status-right "#[fg=colour103] I use Arch BTW "
set -g window-status-activity-style 'bg=color111,fg=color232'
set-window-option -g window-status-current-format "#[fg=colour214] #W#{?window_zoomed_flag,, } #{?window_zoomed_flag,🔍,}"
set-window-option -g window-status-format "#{?window_activity_flag, #W #{?window_zoomed_flag,, }#{?window_zoomed_flag,🔍,},#[fg=colour103] #W #{?window_zoomed_flag,, }#{?window_zoomed_flag,🔍,}}"
set -g pane-active-border-style "fg=color220"
#set-window-option window-status-activity-status "#[bg=color175 fg=color255] lol"
# Visual and Yank in Tmux like in VIM.
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel 'xclip -in -selection clipboard'
# Better Pane Resizing
bind-key -r -T prefix K resize-pane -U 5
bind-key -r -T prefix J resize-pane -D 5
bind-key -r -T prefix H resize-pane -L 5
bind-key -r -T prefix L resize-pane -R 5
bind-key -r -T prefix C-Up resize-pane -U
bind-key -r -T prefix C-Down resize-pane -D
bind-key -r -T prefix C-Left resize-pane -L
bind-key -r -T prefix C-Right resize-pane -R
# Binding some quick actions.
bind-key -n M-f neww tmux-switch # See .local/bin/tmux-switch
bind-key -n M-s choose-session
bind-key -n M-w neww tmux-work-switch # See .local/bin/tmux-work-switch
# bind-key -n M-g run ws # See .local/bin/tmux-work-switch
bind-key -n M-e run pose # See .local/bin/pose
bind-key -n M-z neww tmux-switch ~/repos/github.com/davidpeach/zet/
bind-key -n M-d neww tmux-switch ~/repos/github.com/davidpeach/dotfiles/
bind-key -n M-B display-popup -T Battery -w 20 -h 5 -s "bg=#ffffff fg=#ff0000" -S "bg=#ffffff fg=#ff0000" ~/.local/bin/tmux-battery
bind-key -n M-g display-popup -T Git -w 80% -h 65% -s "bg=#303030" -S "fg=#d0d0d0 bg=#353535" bash -c 'git status ; bash'
bind-key x kill-pane # skip "kill-pane 1? (y/n)" prompt
bind-key k "switch-client -l" # Quick switching between the last 2 sessions
# Bindings to enable and disable synchronizing panes
bind-key C-x setw synchronize-panes on
bind-key C-y setw synchronize-panes off
# Smart pane switching with awareness of Vim splits.
# See: https://github.com/christoomey/vim-tmux-navigator
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|l?n?vim?x?|fzf)(diff)?$'"
bind-key -n 'C-h' if-shell "$is_vim" 'send-keys C-h' 'select-pane -L'
bind-key -n 'C-j' if-shell "$is_vim" 'send-keys C-j' 'select-pane -D'
bind-key -n 'C-k' if-shell "$is_vim" 'send-keys C-k' 'select-pane -U'
bind-key -n 'C-l' if-shell "$is_vim" 'send-keys C-l' 'select-pane -R'
tmux_version='$(tmux -V | sed -En "s/^tmux ([0-9]+(.[0-9]+)?).*/\1/p")'
if-shell -b '[ "$(echo "$tmux_version < 3.0" | bc)" = 1 ]' \
"bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\' 'select-pane -l'"
if-shell -b '[ "$(echo "$tmux_version >= 3.0" | bc)" = 1 ]' \
"bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\\\' 'select-pane -l'"
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
# Reload tmux configuration file.
bind-key r source-file ~/.tmux.conf \; display-message " Tmux configuration reloaded."