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

Re: How to add two lines in vim?

Expand Messages
  • Bee
    On Jan 20, 3:16 pm, Chris Schneider ... It is a little strange that it does not populate the file with the blank lines until
    Message 1 of 8 , Jan 20, 2013
    • 0 Attachment
      On Jan 20, 3:16 pm, Chris Schneider <ch...@...>
      wrote:
      > That's what I get for not checking help before replying :)  Didn't realize
      > that took a count.

      It is a little strange that it does not populate the file with the
      blank lines until <esc> is pressed. Mac terminal vim version 7.3.762

      Bill

      --
      You received this message from the "vim_use" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php
    • Chris Schneider
      I don t see that behavior in macvim. I get new lines that are there right away. ... -- You received this message from the vim_use maillist. Do not top-post!
      Message 2 of 8 , Jan 20, 2013
      • 0 Attachment
        I don't see that behavior in macvim. I get new lines that are there right away.


        On Sun, Jan 20, 2013 at 4:22 PM, Bee <forth@...> wrote:
        On Jan 20, 3:16 pm, Chris Schneider <ch...@...>
        wrote:
        > That's what I get for not checking help before replying :)  Didn't realize
        > that took a count.

        It is a little strange that it does not populate the file with the
        blank lines until <esc> is pressed. Mac terminal vim version 7.3.762

        Bill

        --
        You received this message from the "vim_use" maillist.
        Do not top-post! Type your reply below the text you are replying to.
        For more information, visit http://www.vim.org/maillist.php

        --
        You received this message from the "vim_use" maillist.
        Do not top-post! Type your reply below the text you are replying to.
        For more information, visit http://www.vim.org/maillist.php
      • Marvin Renich
        ... Actually, the trailing i is only needed if you want to end up in insert mode, and is not part of the command that inserts multiple lines. Note that any
        Message 3 of 8 , Jan 20, 2013
        • 0 Attachment
          * Bee <forth@...> [130120 18:24]:
          >
          >
          > On Jan 20, 3:13 pm, Bee <fo...@...> wrote:
          > > On Jan 20, 2:52 pm, Peng Yu <pengyu...@...> wrote:
          > >
          > > > Hi,
          > >
          > > > O can only add one lines. I'm wondering if there is a built in command to add two lines at a time in vim. Does anybody know?
          > >
          > > > Thanks,
          > > > Peng
          > >
          > > If you do 2O<return><esc> you will have two lines
          > > --OR--
          > > try 22O<return><esc> and you will have 22 new lines
          > >
          > > Bill
          >
          > Correction:
          >
          > 2O<esc>i
          > --OR--
          > 22O<esc>i

          Actually, the trailing i is only needed if you want to end up in insert
          mode, and is not part of the command that inserts multiple lines.

          Note that any text inserted as part of the O or o command gets inserted
          multiple times, as well. So that 5OHello<esc> will insert the line
          «Hello» five times.

          The delay between the <esc> and inserting the repetitions of the text
          only occurs in terminal vim, not gvim or macvim. It is a consequence of
          the keyboard handling. Terminal vim must wait a little bit to see if
          the <esc> is part of a terminal escape sequence for keys like the arrow
          keys or function keys.

          HTH...Marvin

          --
          You received this message from the "vim_use" maillist.
          Do not top-post! Type your reply below the text you are replying to.
          For more information, visit http://www.vim.org/maillist.php
        Your message has been successfully submitted and would be delivered to recipients shortly.