comparison dot_tmux.conf @ 568:91d89b637bd6

clean up tmux.conf
author zegervdv <zegervdv@me.com>
date Sun, 27 Feb 2022 11:49:49 +0100
parents 697909624a17
children ad5e870cd4b2
comparison
equal deleted inserted replaced
567:edace2b7e913 568:91d89b637bd6
39 39
40 setw -g window-status-bell-style "fg=colour0,bg=colour5" 40 setw -g window-status-bell-style "fg=colour0,bg=colour5"
41 41
42 bind s split-window -v -c "#{pane_current_path}" 42 bind s split-window -v -c "#{pane_current_path}"
43 bind v split-window -h -c "#{pane_current_path}" 43 bind v split-window -h -c "#{pane_current_path}"
44 bind a split-window -v -p 15 -c "#{pane_current_path}"
45 # bind c new-window -c "#{pane_current_path}"
46 bind c command-prompt -p "Name:" "new-window -c \"#{pane_current_path}\" -n %%" 44 bind c command-prompt -p "Name:" "new-window -c \"#{pane_current_path}\" -n %%"
47 45
48 # Enable delete in command sequencer 46 # Enable delete in command sequencer
49 bind h send-keys 'c-h' 47 bind h send-keys 'c-h'
50 48
55 bind Escape copy-mode 53 bind Escape copy-mode
56 set-window-option -g mode-keys vi 54 set-window-option -g mode-keys vi
57 bind-key -T copy-mode-vi 'v' send -X begin-selection 55 bind-key -T copy-mode-vi 'v' send -X begin-selection
58 bind-key -T copy-mode-vi 'V' send -X select-line 56 bind-key -T copy-mode-vi 'V' send -X select-line
59 bind-key -T copy-mode-vi 'r' send -X rectangle-toggle 57 bind-key -T copy-mode-vi 'r' send -X rectangle-toggle
60 bind-key -T copy-mode-vi 'y' send -X copy-pipe-and-cancel 'xclip -in -selection clipboard'
61 unbind-key -T copy-mode-vi MouseDragEnd1Pane 58 unbind-key -T copy-mode-vi MouseDragEnd1Pane
62 unbind -T copy-mode-vi MouseDragEnd1Pane 59 unbind -T copy-mode-vi MouseDragEnd1Pane
63 # unbind -t vi-copy MouseDragEnd1Pane 60 # unbind -t vi-copy MouseDragEnd1Pane
64 61
65 # Smart pane switching with awareness of Vim splits. 62 # Smart pane switching with awareness of Vim splits.
79 bind-key -T copy-mode-vi 'C-h' select-pane -L 76 bind-key -T copy-mode-vi 'C-h' select-pane -L
80 bind-key -T copy-mode-vi 'C-j' select-pane -D 77 bind-key -T copy-mode-vi 'C-j' select-pane -D
81 bind-key -T copy-mode-vi 'C-k' select-pane -U 78 bind-key -T copy-mode-vi 'C-k' select-pane -U
82 bind-key -T copy-mode-vi 'C-l' select-pane -R 79 bind-key -T copy-mode-vi 'C-l' select-pane -R
83 bind-key -T copy-mode-vi 'C-\' select-pane -l 80 bind-key -T copy-mode-vi 'C-\' select-pane -l
84 #act like GNU screen 81
85 unbind C-b 82 unbind C-b
86 set -g prefix C-Space 83 set -g prefix C-Space
87 bind Space send-prefix 84 bind Space send-prefix
88 set -g escape-time 20 85 set -g escape-time 20
89 86
110 set-window-option -g bell-action other 107 set-window-option -g bell-action other
111 108
112 # Local config 109 # Local config
113 if-shell "[ -f ~/.tmux.conf.local ]" 'source ~/.tmux.conf.local' 110 if-shell "[ -f ~/.tmux.conf.local ]" 'source ~/.tmux.conf.local'
114 111
115 # Plugins
116 # set -g @plugin 'tmux-plugins/tpm'
117 # set -g @plugin 'nhdaly/tmux-better-mouse-mode'
118 # set -g @plugin 'tmux-plugins/tmux-yank'
119 # set -g @plugin 'Morantron/tmux-fingers'
120 # set -g @plugin 'laktak/extrakto'
121 # set -g @plugin 'tmux-plugins/tmux-resurrect'
122 # set -g @plugin 'tmux-plugins/tmux-continuum'
123
124
125 # Config 112 # Config
126 set -g @scroll-without-changing-pane "on" 113 set -g @scroll-without-changing-pane "on"
127 set -g @emulate-scroll-for-no-mouse-alternate-buffer "on" 114 set -g @emulate-scroll-for-no-mouse-alternate-buffer "on"
128 115
129 run-shell ~/.tmux/plugins/tmux-better-mouse-mode/scroll_copy_mode.tmux 116 run-shell ~/.tmux/plugins/tmux-better-mouse-mode/scroll_copy_mode.tmux
134 # Swap behaviour 121 # Swap behaviour
135 set -g @thumbs-command 'tmux set-buffer -w -- {} && tmux paste-buffer && tmux display-message \"Copied {}\"' 122 set -g @thumbs-command 'tmux set-buffer -w -- {} && tmux paste-buffer && tmux display-message \"Copied {}\"'
136 set -g @thumbs-upcase-command 'tmux set-buffer -w -- {} && tmux display-message \"Copied {}\"' 123 set -g @thumbs-upcase-command 'tmux set-buffer -w -- {} && tmux display-message \"Copied {}\"'
137 set -g @thumbs-hint-fg-color red 124 set -g @thumbs-hint-fg-color red
138 set -g @thumbs-reverse enabled 125 set -g @thumbs-reverse enabled
139
140 set -g word-separators " "
141 bind -n C-DoubleClick1Pane if -F '#{m/r:^[^:]*:[0-9]+:,#{mouse_word}}' {
142 run -C { popup -w90% -h90% -E -d '#{pane_current_path}' '
143 nvim `echo #{mouse_word}|awk -F: "{print \"+\"\\$2,\\$1}"`
144 ' }
145 } {
146 run -C { popup -w90% -h90% -E -d '#{pane_current_path}' '
147 nvim "#{mouse_word}" || read -p "Press key to continue.. " -n1 -s
148 ' }
149 }
150 126
151 bind-key -n 'C-q' popup -w50% -h 90% -x 90% -E -d '#{pane_current_path}' chezmoi cd 127 bind-key -n 'C-q' popup -w50% -h 90% -x 90% -E -d '#{pane_current_path}' chezmoi cd
152 128
153 bind-key -n 'C-z' if -F '#{window_zoomed_flag}' "resize-pane -Z" "send-keys C-z" 129 bind-key -n 'C-z' if -F '#{window_zoomed_flag}' "resize-pane -Z" "send-keys C-z"
154 130