I know .
operator concatenate strings.
But how to repeat a string N times, similar to "abc" * 3
in python?
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 communityI know .
operator concatenate strings.
But how to repeat a string N times, similar to "abc" * 3
in python?
To repeat a string you want to use the (appropriately named) function repeat()
The doc is here :h repeat()
And you can use it like that:
let foo = repeat("abc", 3)
:help function-list
is a very useful page when VimScripting. – Martin Tournoij Dec 5 '17 at 7:13