-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tmux.conf
109 lines (83 loc) · 3.41 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
set -g default-terminal "tmux-256color"
setenv -g PATH "$HOME/.argsdotfiles/bin:$PATH"
# Tmux plugin manager https://github.com/tmux-plugins/tpm
# git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
# 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 @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-pain-control'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'tmux-plugins/tmux-copycat'
set -g @plugin 'tmux-plugins/tmux-urlview' # requires urlview or extract_url globally installed
set -g @plugin 'laktak/extrakto'
set -g @fingers-compact-hints 0
# Last saved environment is automatically restored when tmux is started.
set -g @continuum-restore 'on'
# try to resurrect vim
set -g @resurrect-strategy-nvim 'session'
set -g @resurrect-save 'T' # cause i hit default `prefix + s` too often
set -g @extrakto_split_direction 'v'
# remap <c-b> to <c-a>
set -g prefix C-a
# start with 1 instead of 0
set -g base-index 1
# no escape timeout
set -sg escape-time 0
set-option -g default-command 'zsh'
# enable vi like keybindings
set-window-option -g mode-keys vi
# bind v and y to act as vi keys
bind-key -Tcopy-mode-vi 'v' send -X begin-selection
# bind-key -Tcopy-mode-vi 'y' send -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"
bind-key -Tcopy-mode-vi Escape send -X cancel
bind-key -Tcopy-mode-vi V send -X rectangle-toggle
set -g set-clipboard off
# bind shift-left & shift-right so that they would spaw current window
bind-key -n S-Left swap-window -t -1
bind-key -n S-Right swap-window -t +1
# move between windows with left and right
bind-key -n S-Up previous-window
bind-key -n S-Down next-window
# fuzzy find sessions
bind-key -T prefix s "display-popup -E -h 20 -w 50 ,tmux-fuzzy-session-choose"
# switch to last session
bind-key -T prefix ] switch-client -l
bind-key P run-shell "vim-edit-tmux-output"
# pane border color configs
set -g pane-border-style bg=colour16,fg=colour235
set -g pane-active-border-style bg=colour16,fg=colour16
set -g status-position top
set -g status-style bg=colour16,fg=white
set -g status-left " #H #S "
set -g status-left-style bg=colour235,fg=white
set -g status-left-length 70
set -g status-right-length 50
set -g status-right \
"#[fg=colour245,nobright] \
#(uptime | rev | cut -d":" -f1 | rev | sed s/,//g) | \
#(tmux-battery) | \
#(query-keyboard-layout) | \
◷ %Y-%m-%d %H:%M "
set -g status-left-length 70
set -g window-status-format " #I: #W "
set -g window-status-current-format " #I: #W "
set -g window-status-current-style bold
# enable mouse scroll, selection
set -g mouse on
# set aggressive resize
setw -g aggressive-resize on
# prevent window renaming
set -g allow-rename 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|n?vim?x?)(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"
bind-key -n C-\\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l"
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'