tmux-plugins / tmux-copycat

A plugin that enhances tmux search
MIT License
1.11k stars 63 forks source link

Ignore $PROMPT text in backward searches #132

Open bedge opened 6 years ago

bedge commented 6 years ago

My prompt matches both path and numeric seaches:

 29/10/18 07:40:54 ~ 🐍 p3 
❯

I use this for auditing purposes, along with logging.

While it would be possible to introspect the $PROMPT/$PS1 and figure out what to ignore, I'd be happy with being able to specify a regex to ignore as well. In fact, that may provide better flexibility for unforeseen use cases.

micimize commented 5 years ago

Seconded - the fact that copycat doesn't at bare minimum have a configuration for this makes it pretty unusable for me with a prompt like 01-16 10:39 > ~/Doc…/code/ which matches both the file and number patterns

Drowze commented 11 months ago

Stumbled on this... Would love to see this builtin tmux.

For context, my prompt is something like (consider I'm on ~/workspace/my-projects)

⋊> ~/w/my-projects/ 

And I have the following pattern in my tmux config, for grepping for filenames in my pane. It unfortunately matches my prompt as well and I couldn't manage to fix yet...

bind C-f copy-mode \; send -X search-backward "(^|^\.|[[:space:]]|[[:space:]]\.|[[:space:]]\.\.|^\.\.)[[:alnum:]~_-]*/[][[:alnum:]_.#$%&+=/@-]*"