From b29dc4e14756d755731f8cab8cb84a5b1e2c7d89 Mon Sep 17 00:00:00 2001 From: Anton Bobov Date: Wed, 14 Aug 2024 23:56:52 +0500 Subject: tmux: Update search bindings --- files/.config/tmux/scripts/search | 7 ++++++- files/.config/tmux/tmux.conf | 5 +++-- 2 files changed, 9 insertions(+), 3 deletions(-) (limited to 'files/.config') diff --git a/files/.config/tmux/scripts/search b/files/.config/tmux/scripts/search index 027f789..53728b4 100755 --- a/files/.config/tmux/scripts/search +++ b/files/.config/tmux/scripts/search @@ -3,6 +3,8 @@ set -euo pipefail +urls='(https?://|git@|git://|ssh://|ftp://|file:///)[[:alnum:]?=%/_.:,;~@!#$&()*+-]*' + search() { tmux send-keys -X search-backward "$1" } @@ -18,8 +20,11 @@ search_path() { search "~?(/$path+|$path+/|$path*\.$path+)+$path*(:[0-9]+)*" } +search_url() { + search "$urls" +} + search_interesting() { - urls='(https?://|git@|git://|ssh://|ftp://|file:///)[[:alnum:]?=%/_.:,;~@!#$&()*+-]*' emails='[-_\.[:alnum:]]+@[-_\.[:alnum:]]+' hashes='\b(([0-9a-f]{7,40}|[[:alnum:]]{52}|[0-9a-f]{64})(\.{2,3})?)+\b' ips='[[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3}' diff --git a/files/.config/tmux/tmux.conf b/files/.config/tmux/tmux.conf index 9ec8220..fc30009 100644 --- a/files/.config/tmux/tmux.conf +++ b/files/.config/tmux/tmux.conf @@ -61,8 +61,9 @@ set -g status-right "$USER@#h %H:%M" # Search search='~/.config/tmux/scripts/search' bind / run "$search" -bind -n C-F run "$search path" -bind -n C-G run "$search interesting" +bind C-F run "$search path" +bind C-U run "$search url" +bind C-G run "$search interesting" set -g @colors-solarized 'light' -- cgit v1.2.3