Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Match quoted strings #134

Open
flowchartsman opened this issue Feb 16, 2023 · 7 comments
Open

Match quoted strings #134

flowchartsman opened this issue Feb 16, 2023 · 7 comments

Comments

@flowchartsman
Copy link

It would be super handy to be able to match on quoted strings for certain use-cases, but I cannot get this to work at all. Any ideas?

@fcsonline
Copy link
Owner

You can add a custom RegExp, can't you? https://github.com/fcsonline/tmux-thumbs#thumbs-regexp-N

@flowchartsman
Copy link
Author

Couldn't get that to work. I suppose I should have put that in the issue 😩

Tried set -g @thumbs-regexp-1 '"([^"]+)"' # Quoted strings and a couple of variants. No dice.

@flowchartsman
Copy link
Author

If you have a known-working alternative, would you be willing to share it? Perhaps my syntax is just off.

@hgigas
Copy link

hgigas commented Apr 4, 2023

Same issue

@fcsonline
Copy link
Owner

I have been investigating the problem, and it seems to be a bit more complicated than expected. But I think I can find a solution.

I will let you know soon about it.

@xuyangy
Copy link

xuyangy commented Apr 24, 2023

These at least make the hints show up. The problem is that the paste buffer is not set.
set -g @thumbs-regexp-1 '\x22.+\x22'
set -g @thumbs-regexp-2 '\x27.+\x27'

@Rational-Curiosity
Copy link

Rational-Curiosity commented Apr 27, 2023

Fixed this and another issues but removed off_left and off_right options... Rational-Curiosity/tmux-thumbs

tmux regex capturing quotes:

set-option -g @thumbs-regexp-1 "(?:^|[^\\\\])(\"(?:\\\\\"|[^\"\n])*[^\\\\\n]\"|'(?:\\\\'|[^'\n])*[^\\\\\n]'|`(?:\\\\`|[^`\n])*[^\\\\\n]`)"

---- EDIT ----

Restored off_left and off_right options when possible: #140

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants