I want to substitute this word ${ARRAY1[@]} with $1 on vim substitution command I did


But give me error about number of repetition,i try also "" but doesn't work How to do? Thanks

2 Answers 2


worked for me. Apparently, you must escape [ and ] but not { and }. I always use / instead of : as seperation, but


works as well.

  • To figure out what should or should not be escaped, read the vim documentation on the magic option: :help 'magic'.
    – jw013
    May 19, 2015 at 16:02

Try this way:


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.