If I do this:
:vimgrep /do_action\([ ]?'init'/ **/*.php
I get
E54: Unmatched \(
But I know that there are files with matching text. Why?
I would also be very grateful if someone could help me create a key mapping for cmd+l so that this search is initiated with “init” replaced with the word under the cursor, which I understand from various sources is possible.
Building on kev’s answer, here is your mapping:
But I’d advise you to not use the Command key in a mapping: it works only in MacVim and it’s a good habit to seek portability everywhere possible.
The
<leader>key is perfect for such things.See
:help c_ctrl-r_=and:help leader.edit
I went a little too fast on this one. Not only I’ve added unnecessary cruft to kev’s reworking of your command (silly
//) but I didn’t notice that it could be simplified. This one is tested and working:Sorry for the mess.