-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tmux.conf
59 lines (50 loc) · 2.12 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
# set zsh as your default Tmux shell
set -g default-shell /bin/zsh
set -g default-command "${SHELL}"
set -g default-terminal 'screen-256color'
set -gs terminal-overrides ',*-256color:Tc'
set -s escape-time 0
set -g mouse on
set -g focus-events on
set -g mode-keys vi
setw -g mode-keys vi
set -g prefix C-Space
# plugins
set -g @plugin 'wfxr/tmux-fzf-url'
set -g @plugin 'sainnhe/tmux-fzf'
# tmux == vim navigation
is_vim='echo "#{pane_current_command}" | grep -iqE "(^|\/)g?(view|n?vim?x?)(diff)?$"'
bind -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
bind -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
bind -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U"
bind -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R"
bind -n M-h if-shell "$is_vim" "send-keys M-H" "resize-pane -L 5"
bind -n M-l if-shell "$is_vim" "send-keys M-L" "resize-pane -R 5"
bind -n M-k if-shell "$is_vim" "send-keys M-K" "resize-pane -U 5"
bind -n M-j if-shell "$is_vim" "send-keys M-J" "resize-pane -D 5"
# Splits
bind -n M-. split-window -h -c '#{pane_current_path}'
bind -n M-- split-window -v -c '#{pane_current_path}'
bind -n M-q kill-pane
# vim-like keybinds
bind Escape copy-mode
unbind p
bind -T copy-mode-vi 'p' paste-buffer
bind -T copy-mode-vi 'v' send -X begin-selection
bind -T copy-mode-vi 'y' send -X copy-pipe-and-cancel 'xclip -in -selection clipboard'
bind -T copy-mode-vi 'C-j' send -X halfpage-down
bind -T copy-mode-vi 'C-k' send -X halfpage-up
bind -T copy-mode-vi Escape send -X cancel
bind -T copy-mode-vi V send -X rectangle-toggle
bind -T copy-mode-vi C-k select-pane -U
bind -T copy-mode-vi C-j select-pane -D
bind -T copy-mode-vi C-h select-pane -L
bind -T copy-mode-vi C-l select-pane -R
# copy mouse selection
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "xclip -in -selection clipboard"
#plugin hotkey overrides
bind-key "p" run-shell -b "~/.tmux/plugins/tmux-fzf/scripts/window.sh switch"
# Load theme generated by tmuxline.vim
source $HOME/.config/tmux/tmux-theme.conf
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'