martanne / vis

A vi-like editor based on Plan 9's structural regular expressions

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

literal modifier for regex selections

lanodan opened this issue · comments

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).

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.