-
Notifications
You must be signed in to change notification settings - Fork 4
/
dot_tmux.conf
110 lines (90 loc) · 4.01 KB
/
dot_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
110
# vim: set tabstop=2 shiftwidth=2 foldmethod=marker:
# Plugins and their settings {{{
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-pain-control'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @resurrect-processes 'false'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'spywhere/tmux-named-snapshot'
set -g @named-snapshot-dir "$HOME/.tmux/resurrect/snapshots"
# These 2 are unbound below for a more generic load/restore session keybinding.
# I just specify them here to know precisely what to unbind.
set -g @named-snapshot-save 'C-m:*'
set -g @named-snapshot-restore 'C-n:*'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @yank_selection_mouse 'clipboard'
if-shell 'test "$XDG_SESSION_TYPE" = "x11"' 'set -g @override_copy_command "xsel -i --clipboard"'
set -g @plugin 'sainnhe/tmux-fzf'
TMUX_FZF_OPTIONS="-p -w 80% -h 70% -m"
TMUX_FZF_LAUNCH_KEY="C-f"
# Themes
set -g @plugin 'wfxr/tmux-power'
set -g @tmux_power_theme '#b2b2b2'
set -g @tmux_power_prefix_highlight_pos 'L'
# this must stay after wfxr/tmux-power
set -g @plugin 'tmux-plugins/tmux-prefix-highlight'
set -g @prefix_highlight_show_copy_mode 'on'
set -g @prefix_highlight_bg '#44475a'
set -g @prefix_highlight_fg 'blue,bold'
set -g @prefix_highlight_copy_mode_attr 'fg=blue,bold,bg=#44475a'
set -g @plugin 'nhdaly/tmux-better-mouse-mode'
set -g @scroll-without-changing-pane "on"
set -g @scroll-in-moused-over-pane "on"
set -g @emulate-scroll-for-no-mouse-alternate-buffer "on"
set -g @plugin 'laktak/extrakto'
set -g @extrakto_key e
set -g @extrakto_popup_size '60%,40%'
set -g @plugin 'Morantron/tmux-fingers'
bind -T prefix F command-prompt "find-window -Z -- '%%'"
set -g @fingers-key f
if-shell 'test "$XDG_SESSION_TYPE" = "x11"' 'set -g @fingers-main-action "xsel -i --clipboard"'
set -g @plugin 'IngoMeyer441/tmux-easy-motion'
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T prefix t next-layout
# }}}
set -g mouse on
bind i choose-tree -w "swap-window -t '%%'"
#bind -n C-S-Right next-window
#bind -n C-S-Left previous-window
bind -n M-L next-window
bind -n M-H previous-window
bind ? list-keys
# https://gist.github.com/andersevenrud/015e61af2fd264371032763d4ed965b6
set-option -ag terminal-overrides ",$TERM:RGB"
set-option -g base-index 1
set-option -g renumber-windows on
# options
# server -s (implied)
# session
# globalsession -g
# window -w (implied)
# globalwindow -g
# pane -p
run '~/.tmux/plugins/tpm/tpm'
bind-key -T prefix j choose-tree -Z "join-pane -h -s '%%'"
bind c new-window -c "#{pane_current_path}" -a -n "#{window_name}"
bind C-x command-prompt -p "Send keys to all panes:" \
"run \"tmux list-panes -s -F '##{session_name}:##{window_index}.##{pane_index}' \
| xargs -I PANE tmux send-keys -t PANE '%1' Enter\""
# From https://github.com/christoomey/vim-tmux-navigator
# I don't want the C-\ mapping.
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|l?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 -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
# From https://github.com/denisidoro/navi/blob/master/docs/tmux.md
# Added -s \"\" to avoid immediate execution
bind-key -T prefix C-g split-window "$SHELL --login -i -c 'navi --print | head -n 1 | tmux load-buffer -b tmp - ; tmux paste-buffer -p -t {last} -b tmp -d -s \"\" '"
unbind-key -T prefix C-m
unbind-key -T prefix C-n
bind-key -T prefix C-r display-popup -E -E "navi --best-match --query 'tmux session restore' 2> /dev/null"
bind-key -T prefix C-s display-popup -E -E "navi --best-match --query 'tmux session save' 2> /dev/null"
set -g allow-passthrough on
set -ga update-environment TERM
set -ga update-environment TERM_PROGRAM