I have a text that looks like this
" original
call minpac#add('morhetz / gruvbox')
" desired
call minpac#add('morhetz/gruvbox')
How can I limit vim pattern search within parentheses?
I tried '<,'>s/ //g
in visual selection mode, but the problem is it also removes the indentation at the start as a sideffect. I am looking for a pattern search variation which would only work inside the parenthesis.
I am looking for something in lines of '<,'>s/ //gc
where I can tell vim its n
for first match and y
for all others? I am not even sure if something like this is even possible in vim.
X Y (WWW 22(X Y [A 90] )) #
? Can there be unmatched parenthesis? What about parenthesis inside quotes, should they be considered? Pairs of parenthesis that span multiple lines? Please always think of edge cases. – Quasímodo Oct 21 '20 at 14:56