mirror of
https://github.com/boxpositron/absolute-dotfiles.git
synced 2026-10-24 08:23:19 +00:00
feat(tmux): ctrl+click a file path to open it by type
tmux-open-path takes the path under the mouse, strips :line:col, #L, @ and file:// decorations, and resolves it against the pane directory and then its git root. Markdown opens in Markdown Preview (added to Brewfile.apps), images, PDFs and directories in yazi, and everything else in nvim at the clicked line, both in a split beside the pane.
This commit is contained in:
@@ -142,6 +142,11 @@ bind-key -T copy-mode-vi 'C-\' select-pane -l
|
||||
set -g set-clipboard on
|
||||
set -as terminal-features ',*:clipboard'
|
||||
|
||||
# Ctrl+click a file path in any pane (omo, shell, logs) to open it:
|
||||
# markdown in Markdown Preview, images/pdf/dirs in yazi, the rest in nvim.
|
||||
# yazi and nvim split beside the clicked pane. See ~/.local/bin/tmux-open-path.
|
||||
bind -n C-MouseDown1Pane run-shell -b "~/.local/bin/tmux-open-path #{q:pane_id} #{q:pane_current_path} #{mouse_x} #{q:mouse_line}"
|
||||
|
||||
#
|
||||
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
|
||||
run '~/.tmux/plugins/tpm/tpm'
|
||||
|
||||
Reference in New Issue
Block a user