I'm beginning to use IntelliJ with the vim plugin, and found that commands as simple as
/case (.*)
fail to return any results. Of course, that's not a very useful command. I'd like to reverse the order of all of the elements of my table by executing
:'<,'>s/case (\w*): return (\w*);/case \2: return \1;/
but that also failed to match anything. I tried a few different search regexes and all of them worked as long as there were no capture groups.
Does IntelliJ Vim support capture groups like these? Are there special characters I need to escape to get it to work? I know the builtin search and replace gui lets you do logic with backreferences, but I'd like to do my work right from the command line.
This wouldn't even work in Vim to begin with.
(\w*) is not a capture group; it will match a literal opening parenthesis, followed by any number of any keyword character, followed by a literal closing parenthesis.
\(\w*\) is an actual capture group… which will work both in Vim and in IdeaVim.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With