I have this markdown line,
![Home][screenshots/home.png]
I want to replace it with,

So, I tried this,
:%s/[s/(s/g
Vim(version 81) says pattern not found.
Vi and Vim Stack Exchange is a question and answer site for people using the vi and Vim families of text editors. It only takes a minute to sign up.
Sign up to join this communityYou need to escape the opening square bracket:
:%s/\[s/(s/g
For the whole replace, you can use:
:%s/]\[\(.)]/](\1)
:%s/\[s/(s/g
and :%s/\g]/g)/g
[
starting a character class in a regex (see:help /[]
. You need to escape it with a backslash. This should work::%s/\[s/(s/g
. But much better is to use something like vim-surround, which gives you commands to switch the[]
pair with a()
pair in a single command (cs])
anywhere inside that block.)