61289Re: the perl x operator ( feature request ? )
- Aug 30, 2005Marc Chantreux wrote:
> is there a way to multiply a string by a number as the perl x operatorYou can use the repeat() function. Only in Vim 7 though!
> do ? i haven't found it on the vim doc ( using vim7).
> in perl :
> $x = 'ab' x 4
> $x == 'abababab'
> it could be usefull to write something like :
> or :
> let indent = ' ' x &sw
> in the case that there is no way to do it in vim, this is a feature
> request ! :)
:let x = repeat('ab', 4)
:let seperator = repeat('-', 80)
hundred-and-one symptoms of being an internet addict:
131. You challenge authority and society by portnuking people
/// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
/// Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ Project leader for A-A-P -- http://www.A-A-P.org ///
\\\ Buy LOTR 3 and help AIDS victims -- http://ICCF.nl/lotr.html ///
- << Previous post in topic Next post in topic >>