I am using vim with the surround.vim plugin and
want to replace all occurrence of
in a (very long) mathematical expression (containing matching parenthesis).
Currently, I am searching first with
/sin\zs( to jump to the next
sin expression with the cursor on the
( and then type
cs(] to do the replacement
for the matching parenthesis. Then, I can repeat both commands
n (search next) and
. (repeat last command).
This works, but is cumbersome since the expressions is too huge.
Is there a way, how I can automate the whole command sequence
or another way how I can the replacement inside
vim in a fully automated way?
There are probably completely other ways to do the conversion outside vim, but for educational reasons I am especially interested in a vim solution to the problem.