vimscript - 获取由单个字符的多个副本组成的字符串

vimscript - get a string consisting of multiple copies of a single char

所以,我想做类似 let dummy_string = 'a' * 6 的事情,让 dummy_string 包含一个 aaaaaa 字符串。

使用repeat(),详情见:help repeat()

let dummy_string = repeat('a',6)

Vi and Vim, vimscript: how to repeat a string N times?

中的相关问题