3 ms·
\v is your friend. http://vimdoc.sourceforge.net/htmldoc/pattern.html#/magic http://vimdoc.sourceforge.net/htmldoc/pattern.html#/magic
by Leszek 13y ago
\v is your friend.
http://vimdoc.sourceforge.net/htmldoc/pattern.html#/magic http://vimdoc.sourceforge.net/htmldoc/pattern.html#/magic
- jholman 13y agoI sort of prefer \V, but same difference I dunno, I haven't used it in the past, because... 1) "It is recommended to always keep the 'magic' option at the default setting, which is 'magic'. This avoids portability problems." 2) Nor do I want to type two extra characters in every damn regex! So, it only occurs to me right now, the right thing to do for me is this: the first instant I'm confused about whether \( means grouping or literal paren, I should immediately start my pattern with \v or \V. No unportability of plugins, no marginal cost on regexes that don't care, marginal benefit when it does matter.
- Leszek 13y agoYeah, that's basically what I do too. No \v on trivial regexes, \v on ones where there's more than one or two groups.