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

literal modifier for regex selections #1159

Open
lanodan opened this issue Dec 25, 2023 · 2 comments
Open

literal modifier for regex selections #1159

lanodan opened this issue Dec 25, 2023 · 2 comments

Comments

@lanodan
Copy link
Contributor

lanodan commented Dec 25, 2023

Selecting code containing a lot of braces via is quite a chore and can lead to mistakes if you're not careful.
I think a modifier should exists for literal (non-regex) matches, for example having l as this modifier you could avoid x/\[\$\{FOO\}\]/ … and simply have x/[${FOO}]/l ….

By the way for ones wanting a simple selection of existing text, there is C-a in visual mode, but it has the limitation of not being chainable like commands are (for example if you only want to change [${FOO}] in an already selected function-block).

@ninewise
Copy link
Collaborator

Being able to match literal strings would be nice to have. I'd not use a modifier like suggested, though, because the vis command line syntax currently does not have the concept of modifiers at all. I'm not sure what syntax would be better though, regex(7) does not support longer literals matches.

@mcepl
Copy link
Contributor

mcepl commented Oct 23, 2024

I guess adding a new command? We don’t have l/pattern/.

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

No branches or pull requests

4 participants