In Vim I have:
simulación (fig.),pretexto (fig.),excusa (fig.).
My goal is:
simulación ,pretexto ,excusa .
I have tried with: :%s/\(fig\.\)//g
, but it doesn't work.
Explanation. If you want to put the word under the cursor in to brackets this is viwc()<Esc>P . viw will v isually select all charactrs i n a w ord. c() will c change the selection and by dropping you into insert mode, where you type the characters ( ) .
Vim doesn't require escaping of brackets by default. Try:
:%s/(fig\.)//g
See:
:help magic
Edit
Added backslash escaping of dot.
Don't escape the parens - vim by default uses a "magic" escaping scheme. Try:
:%s/(fig\.)//g
More info: http://vimdoc.sourceforge.net/htmldoc/pattern.html#/\v
On Vim 7.2 (WinXP), the command you used only removes 'fig.', but not the parentheses.
Using %s/(fig\.)//g
gives the intended result.
Edit Escaped the dot too, as it matches any character, not just a dot.
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