Loading ...
Sorry, an error occurred while loading the content.

61326Re: the perl x operator ( feature request ? )

Expand Messages
  • Wes Potts
    Aug 31, 2005
      It appears you are more interested in a script solution but, I
      sometimes prefix the normal mode insert command 'i' with a count. Say
      I wish to insert a line with 60 '#' characters into a shell script, I
      simply use:

      60i#<ESC>

      Hope this helps.

      Wes

      On 8/30/05, Marc Chantreux <marc.chantreux@...> wrote:
      > hi all,
      >
      > is there a way to multiply a string by a number as the perl x operator
      > 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 :
      >
      > :s/.*/\='-'len(submatch(0))/
      >
      > or :
      >
      > let indent = ' ' x &sw
      >
      >
      > in the case that there is no way to do it in vim, this is a feature
      > request ! :)
      >
      > regards
      >
      > mc
      >
      >
    • Show all 6 messages in this topic