-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.tmux.conf
71 lines (56 loc) · 2.5 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
set-option -g default-terminal "xterm-256color"
set -ga terminal-overrides ",xterm-256color*:Tc"
set -s escape-time 0
setw -g mode-keys vi
bind r source-file ~/dotfiles/.tmux.conf
set -g base-index 1
bind -r ^ last-window
bind -r Left resize-pane -L 5
bind -r Up resize-pane -U 5
bind -r Down resize-pane -D 5
bind -r Right resize-pane -R 5
#unbind window moving as this is done with vim-tmux-navigator
unbind C-h
unbind C-l
#rebind copy and paste to feel more vim like
bind p paste-buffer
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi y send-keys -X copy-selection-and-cancel
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel
#for mac shortcuts
#bind -T copy-mode-vi v send -X begin-selection
#bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "pbcopy"
#bind P paste-buffer
#bind -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "pbcopy"
#maximize window on prefix + m
bind -r m resize-pane -Z
#for nvim instead of tmux statusline
set -g focus-events on
set -g status-style bg=default
set -g status-left-length 90
set -g status-right-length 90
set -g status-justify centre
set -g mouse on
bind-key -r f run-shell "tmux neww ~/.local/bin/tmux-sessionizer"
# 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-Left' if-shell "$is_vim" 'send-keys C-Left' 'select-pane -L'
bind-key -n 'C-Down' if-shell "$is_vim" 'send-keys C-Down' 'select-pane -D'
bind-key -n 'C-Up' if-shell "$is_vim" 'send-keys C-Up' 'select-pane -U'
bind-key -n 'C-Right' if-shell "$is_vim" 'send-keys C-Right' '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-Left' select-pane -L
bind-key -T copy-mode-vi 'C-Down' select-pane -D
bind-key -T copy-mode-vi 'C-Up' select-pane -U
bind-key -T copy-mode-vi 'C-Right' select-pane -R
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'