Thanks! Using the repeat command, here is the solution I've implemented: function! MySpam() let ip=input("Enter IP address or domain name: ") if (ip != "") let col = 30 let rej = 'REJECT "550 SPAMMER NINCOMPOOP REJECTED!!!' let iplen = len(ip) let padding = col - len(ip) let padding = ip.repeat(' ', padding).rej call append( line("."), padding) call cursor(line(".")+1, 1) endif endfunction