Closed toupeira closed 4 years ago
This is great news. Native regex support will be much faster and better implemented I'm sure.
As for the transition: I think we can leave this plugin as-is. Maybe it will be useful to some users stuck on older tmux versions. We can add a note to the README about new tmux features.
As for the useful parts: we can create a new, much smaller plugin for that.
A note about tmux's native regex support has been added to the readme.
@bruno- thanks, sounds good to me! :+1: Feel free to close this issue.
I played around with the native regex search a bit, it is indeed much faster and supports the same extended regex syntax, so I could just reuse the patterns from tmux-copycat
. But I ran into a problem with moving between matches which is being discussed in https://github.com/tmux/tmux/issues/2301, so at the moment I'm still using this plugin.
Yes, I think this plugin still has some extra features. Once tmux natively implements search highlighting (search match selection) it will become obsolete.
@toupeira do you want to work on a copycat replacement plugin?
I know this is closed, but I'd like to leave the config I've been using on 3.2 instead of tmux-copycat and tmux-yank for anyone who's curious to try (inspired by this issue):
# Copy selection with y
bind-key -T copy-mode-vi y send -X copy-selection-no-clear
# Search backwards with prefix-/
bind / copy-mode \; send ?
# Somewhat tmux-copycat select url functionality (requires 3.1+)
bind C-u copy-mode \; send -X search-backward "(https?://|git@|git://|ssh://|ftp://|file:///)[[:alnum:]?=%/_.:,;~@!#$&()*+-]*"
@toupeira do you want to work on a copycat replacement plugin?
Oh I also forgot to respond to this, I guess a plugin feels like overkill if it's just a bunch of regex patterns, and it becomes more complicated to customize the plugin rather than just writing your own mappings :grinning:
But I've been happily using the native regex search too, with these mappings:
And this helper script:
Native regex search was added in the recently released tmux 3.1: https://github.com/tmux/tmux/issues/2178
tmux 3.2 will also make it possible to copy the current match with
copy-selection
(see discussion in that issue), so at that point I thinktmux-copycat
can be greatly simplified and basically turn into a (still very useful!) collection of default keybindings and search patterns.Some considerations:
grep -E
). In a quick test they indeed seem to work fine.copy-selection
behaviour.