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

Re: copy text in insert mode

Expand Messages
  • Christian Brabandt
    ... Now you can in insert mode visually select your text using Shift+Cursor keys and the selection will be automatically copied to the clipboard. regards,
    Message 1 of 6 , Jan 8, 2013
    View Source
    • 0 Attachment
      On Tue, January 8, 2013 13:09, vicky b wrote:
      > is there by any chance an option to copy text in insert mode

      :set guioptions+=a keymodel=startsel,stopsel

      Now you can in insert mode visually select your text using
      Shift+Cursor keys and the selection will be automatically copied
      to the clipboard.

      regards,
      Christian

      --
      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
    • Tim Chase
      ... I forgot to mention that: 1) if you re running in X (rather than MacVim or on Win32), and 2) you don t have Vim set to intercept the mouse, and 3) the text
      Message 2 of 6 , Jan 8, 2013
      View Source
      • 0 Attachment
        On 01/08/13 07:05, vicky b wrote:
        > hmm , there are few things which i find quiet inconvenient but other wise
        > vim is superior to other editors ,

        I forgot to mention that:

        1) if you're running in X (rather than MacVim or on Win32), and
        2) you don't have Vim set to intercept the mouse, and
        3) the text you want to copy/paste is completely on the screen

        you can select the text in your terminal window, and then paste the
        selection buffer using

        <c-r>*

        all without leaving Insert mode. Granted, your hands leave the
        home-row, but only you can decide whether that trade-off is worth
        it. I, like many other Vimmers, tend to spend most of my time in
        Normal mode, so I'm only ever in Insert mode for the insertion of
        text and then I reflexively hit <esc> to return to Normal mode.
        Drew Neil mentions this in his recently-released "Practical Vim"
        (full disclosure: I was a tech reviewer for the book)

        > once more such thing is like if i edit a characeter in each line
        > then i have to edit the char go back to normal mode press j then
        > edit and cycle repeats is there a any other way

        I'm not sure I fully understand your edit cycle. If you're
        replacing characters with the same character, you can do it once
        with "r" in normal mode and then use the dot (".") command to repeat
        it while moving around in normal mode. If there's a pattern to the
        locations in which it happens, you may be able to use a :s///
        command to locate them and change them accordingly (possibly using
        the "c" flag to do them selectively).

        You can also move around in Insert mode (or Replace mode if that
        facilitates your editing) using the arrow-keys. It's not illegal,
        just that it can be less efficient, so many people eschew using them.

        For my basic understanding of your process, you'd hit "R" to go into
        Replace mode, then type your letter, hit <down>, <left>, next
        letter, repeat until done.

        -tim




        --
        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
      • Gary Johnson
        ... If you are changing one character in each line, you can use the r command. If all the characters are in the same column, you can just type r the new
        Message 3 of 6 , Jan 8, 2013
        View Source
        • 0 Attachment
          On 2013-01-08, vicky b wrote:
          > hmm , there are few things which i find quiet inconvenient but other wise vim
          > is superior to other editors , once more such thing is like if i edit a
          > characeter in each line then i have to edit the char go back to normal mode
          > press j then edit and cycle repeats is there a any other way

          If you are changing one character in each line, you can use the r
          command. If all the characters are in the same column, you can just
          type

          r
          the new character on the first line
          jr
          the new character on the second line
          jr

          and so on.

          To change all the characters in one column to the same character,
          you can either type

          r
          the new character
          j.

          and keep repeating j. for each line to be changed, or you can type

          Ctrl-V
          j

          and keep typing j until the desired column is highlighted, then type

          r
          the new character

          HTH,
          Gary

          --
          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.