# HG changeset patch # User zegervdv # Date 1703539451 0 # Node ID 0c2dcf35d759185c51fb35b06ae4caa97f626ac9 # Parent 03e12088279174e41f9b3185015fe5c3d4bd1d9f feat: show fzf to select paths from last command output diff -r 03e120882791 -r 0c2dcf35d759 dot_tmux.conf --- a/dot_tmux.conf Fri Dec 15 08:05:00 2023 +0100 +++ b/dot_tmux.conf Mon Dec 25 21:24:11 2023 +0000 @@ -164,5 +164,42 @@ bind-key -T copy-mode-vi 's' send -X copy-pipe-and-cancel "cat > /tmp/error.txt && tmux new-window -n 'quickfix' -c \"#{pane_current_path}\" 'nvim -q /tmp/error.txt && rm -f /tmp/error.txt'" + +bind-key 'o' { + copy-mode + send -X clear-selection + send -X start-of-line + send -X start-of-line + send -X cursor-up + send -X cursor-up + send -X start-of-line + send -X start-of-line + + if -F "#{m:*->\u00A0*,#{copy_cursor_line}}" { + send -X search-forward-text "->\u00A0" + send -X stop-selection + send -X -N 2 cursor-right + send -X begin-selection + send -X end-of-line + send -X end-of-line + if "#{m:*->\u00A0?*,#{copy_cursor_line}}" { + send -X cursor-left + } + } { + send -X end-of-line + send -X end-of-line + send -X begin-selection + send -X search-backward-text "->\u00A0" + send -X end-of-line + send -X end-of-line + send -X cursor-right + send -X stop-selection + } + + send -X copy-pipe-and-cancel "grep -oE '([^\s]+)\/([^/]+)' | fzf-tmux -d20 --multi --bind alt-a:select-all,alt-d:deselect-all | paste -sd \" \" - | xargs -I {} tmux send-keys -t #{pane_id} \"{}\"" + +} + + # unbind after loading plugins unbind -T copy-mode-vi MouseDragEnd1Pane