-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.tmux.conf
125 lines (100 loc) · 4.65 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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# neovim true color
# https://gist.github.com/andersevenrud/015e61af2fd264371032763d4ed965b6
set -g default-terminal tmux-256color
set-option -sa terminal-overrides ',xterm-256color:RGB'
set-option -sg escape-time 20
set -g mouse on
set -g focus-events on
# Theme
set -g @plugin 'dracula/tmux'
set -g @dracula-show-powerline true
# Copy Mode
set-window-option -g mode-keys vi
unbind -T copy-mode-vi Enter
set-option -g history-limit 30000
# Wayland
# bind -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel '/usr/bin/wl-copy'
# bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel '/usr/bin/wl-copy'
# bind -T root IC run-shell "tmux set-buffer -b clip \"\$(wl-paste)\" \\; paste-buffer -b clip"
# bind -T prefix v run-shell "wl-paste | tmux load-buffer - && tmux paste-buffer"
# Xorg
bind -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel '/usr/bin/xsel -i -b'
bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel '/usr/bin/xsel -i -b'
bind -T root IC run-shell "tmux set-buffer -b clip \"\$(xsel -o -b)\" \\; paste-buffer -b clip"
bind -T prefix ] run-shell "xsel -o -b | tmux load-buffer - && tmux paste-buffer"
# New pane/window in same pwd
bind 'c' new-window -c "#{pane_current_path}"
bind '"' split-window -c "#{pane_current_path}"
bind '%' split-window -h -c "#{pane_current_path}"
# Title Naming
set-option -g allow-rename off
set-option -g set-titles on
set-option -g set-titles-string "tmux #S / #W"
# Custom Key Mappings
bind -T prefix C-^ last-window # c-6. was ctrl-l
bind -T prefix C-_ switch-client -l # c-7 and c-/
# Deal with conflicts
# vim-tmux-navigator. only c-j/l needed, tho
bind -T prefix C-h send-keys 'C-h'
bind -T prefix C-j send-keys 'C-j'
bind -T prefix C-k send-keys 'C-k'
bind -T prefix C-l send-keys 'C-l'
bind -T prefix C-u send-keys 'C-u'
# Sessions
bind M-0 switch-client -t main
bind M-9 switch-client -t top
bind M-8 switch-client -t left
# Take over some terminal mappings
# bind -T root C-S-v run-shell "xsel -o -b | tmux load-buffer - && tmux paste-buffer"
# bind -T copy-mode-vi C-C send-keys -X copy-pipe-and-cancel "xsel -i -b"
set -g @plugin 'christoomey/vim-tmux-navigator'
# Auto-reload environment
# These 2 plugins must be the last plugins loaded
set -g @resurrect-hook-post-save-all 'sed -i "s/\/tmp.*nvim/nvim/" $(last_resurrect_file)'
set -g @resurrect-processes 'wtfutil python3 python tuir npm'
set -g @plugin 'tmux-plugins/tmux-resurrect'
# https://github.com/tmux-plugins/tmux-resurrect/issues/394#issuecomment-1224204011
# c-b c-s = save, c-b c-r = load
#set -g @plugin 'tmux-plugins/tmux-continuum'
#set -g @continuum-restore 'on'
#set -g @resurrect-strategy-vim 'session'
# set -g @resurrect-strategy-nvim 'session'
#set -g @resurrect-capture-pane-contents 'on'
# tmux list-panes -a -F "#{pane_pid}" | xargs -rn1 ps -h -o args --ppid {}
# tmux list-panes -a -F "#{pane_pid}" | xargs -rI{} bash -c '( ps -h -o args --ppid {} || ps -h -o args --pid {}; ) | tail -1' | sed 's/^-//'
# https://github.com/mislav/dotfiles/blob/d2af5900fce38238d1202aa43e7332b20add6205/bin/tmux-session
# Auto-install and run. This must be after all plugins
if "test ! -d ~/.tmux/plugins/tpm" \
"run 'git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm && ~/.tmux/plugins/tpm/bin/install_plugins'"
run '~/.tmux/plugins/tpm/tpm'
# Plugin overrides must go after this point
# Status Bar
set-option -g status-interval 5
set-option -g status-right-length 100
set-option -g status-right '#{?window_zoomed_flag,ZOOM | ,}#{session_name}:#{window_index}.#{pane_index} | #(wtfs tmux)'
#HOW-TOs:
# Reload: tmux source-file ~/.tmux.conf
# Reload: c-b I
#TODO:
# Mouse audit mappings
# c-b c-6 - go to previous window, even if on another session
# must use hooks to remember last session, window
# Context menu add: paste, nvim, ranger
# https://gist.github.com/icyleaf/1244274
# https://www.reddit.com/r/tmux/comments/yd5ddd/plugin_for_traversing_from_a_pane_off_the_edge_to/
# https://www.reddit.com/r/tmux/comments/einuqy/make_tmux_modal/
# https://github.com/tmux-plugins/tmux-pain-control
# https://github.com/tmux-plugins/tmux-yank
# https://github.com/tmux-plugins/tmux-sensible
# https://github.com/tmux-plugins/tmux-pomodoro
# yank buffer between current prompt and previous prompt, with option to include command number
# prompt with hidden start/end chararacter sequence for deliniation
# set-environment to change prompt
# capture-pane filter out ansi codes (see tmux-logging for ideas)
# capture-pane or pipe-pane?
# zsh preexec ?
# change rename to send-keys if at a zsh command prompt
# tmux bind ',' send-keys 'tmux rename-window '
# Feature requests
# last-session
# last-window - option to go to another session