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

Re: question: vim copy to another place, eg:doc

Expand Messages
  • Tim Chase
    ... I think (if I understand your intent) you want to use the + or * register, assuming your vim is built with +clipboard You can check the output of ...
    Message 1 of 7 , Jan 2, 2013
    • 0 Attachment
      On 01/02/13 20:15, lei yang wrote:
      > I know in one text,we can use "yy" to copy something to another place
      > in text, if I can't to copy something to another place, eg: from a
      > text,and copy something using vim, and paste( we don't need to use
      > vim) something to another place, how could I do? the real question is
      > how chould I put something to the vim chipboard. and it can paste to
      > another place( doc, terminal)

      I think (if I understand your intent) you want to use the "+" or "*"
      register, assuming your vim is built with +clipboard

      You can check the output of

      :version

      to make sure that you have a build with "+clipboard" rather than
      "-clipboard". You can then specify the register you want, such as

      "+yy

      to yank the line to the system clipboard. You may want to read at

      :help clipboard
      :help registers
      :help quoteplus
      :help quotestar

      (If you use Windows, there is no difference between "*" and "+"; if
      you use an X Window system, there's a subtle difference)

      -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
      ... As Marc and Tim have written, to copy and paste easily between Vim running in a terminal and the X clipboard, you will need a version of Vim with
      Message 2 of 7 , Jan 2, 2013
      • 0 Attachment
        On 2013-01-03, lei yang wrote:
        > Hi experts,
        >
        > I know in one text,we can use "yy" to copy something to another place
        > in text, if I can't to copy something to another place, eg: from a
        > text,and copy something using vim, and paste( we don't need to use
        > vim) something to another place, how could I do? the real question is
        > how chould I put something to the vim chipboard. and it can paste to
        > another place( doc, terminal)

        As Marc and Tim have written, to copy and paste easily between Vim
        running in a terminal and the X clipboard, you will need a version
        of Vim with clipboard, X11 and xterm_clipboard enabled.
        Unfortunately, the vim packages provided by some of the more popular
        Linux distributions do not have these features enabled. If your vim
        does not have those features, and you have gvim installed, you can
        get vim in a terminal with X features enabled by running

        gvim -v

        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
      • Phil Dobbin
        ... I use these mappings to make copy & paste easier: Yank content in OS s clipboard vnoremap yo *y Paste content from OS s clipboard nnoremap
        Message 3 of 7 , Jan 2, 2013
        • 0 Attachment
          On 01/03/2013 02:15 AM, lei yang wrote:

          > Hi experts,
          >
          > I know in one text,we can use "yy" to copy something to another place
          > in text, if I can't to copy something to another place, eg: from a
          > text,and copy something using vim, and paste( we don't need to use
          > vim) something to another place, how could I do? the real question is
          > how chould I put something to the vim chipboard. and it can paste to
          > another place( doc, terminal)

          I use these mappings to make copy & paste easier:

          '"Yank content in OS's clipboard
          vnoremap <leader>yo "*y
          "Paste content from OS's clipboard
          nnoremap <leader>po "*p'

          For this to work in console Vim, Vim would have to be complied
          +clipboard as has been mentioned. If it has, these would need to be
          appended to your ~/.vimrc.

          Cheers,

          Phil...

          --
          currently (ab)using
          CentOS 5.8 & 6.3, Debian Squeeze & Wheezy, Fedora Beefy & Spherical,
          Lubuntu 12.10, OS X Snow Leopard & Ubuntu Precise & Quantal
        • lei yang
          ... I tried many times.My vim is built in +chipboard question: 1) --- press shift+ ? to get ? 2) *y, need press at the same time? 3)how could I select
          Message 4 of 7 , Jan 2, 2013
          • 0 Attachment
            On 1/3/13, Phil Dobbin <phildobbin@...> wrote:
            > On 01/03/2013 02:15 AM, lei yang wrote:
            >
            >> Hi experts,
            >>
            >> I know in one text,we can use "yy" to copy something to another place
            >> in text, if I can't to copy something to another place, eg: from a
            >> text,and copy something using vim, and paste( we don't need to use
            >> vim) something to another place, how could I do? the real question is
            >> how chould I put something to the vim chipboard. and it can paste to
            >> another place( doc, terminal)
            >
            > I use these mappings to make copy & paste easier:
            >
            > '"Yank content in OS's clipboard
            > vnoremap <leader>yo "*y
            > "Paste content from OS's clipboard
            > nnoremap <leader>po "*p'
            >

            I tried many times.My vim is built in +chipboard
            question:
            1)" ---> press shift+" ? to get " ?
            2)"*y, need press at the same time?
            3)how could I select the content I want to copy? can you give me a
            whole process about this ?

            Thanks
            Lei


            > For this to work in console Vim, Vim would have to be complied
            > +clipboard as has been mentioned. If it has, these would need to be
            > appended to your ~/.vimrc.
            >
            > Cheers,
            >
            > Phil...
            >
            > --
            > currently (ab)using
            > CentOS 5.8 & 6.3, Debian Squeeze & Wheezy, Fedora Beefy & Spherical,
            > Lubuntu 12.10, OS X Snow Leopard & Ubuntu Precise & Quantal
            >
            >
            >
            >

            --
            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
          • Nicolas Dermine
            ... hi Lei, 1) juste as you would write a double quote normally. On my swiss keyboard that would be Shift + the key where I have 2, and @. 2) press , * and
            Message 5 of 7 , Jan 2, 2013
            • 0 Attachment



              On Thu, Jan 3, 2013 at 5:44 AM, lei yang <yanglei.fage@...> wrote:
              On 1/3/13, Phil Dobbin <phildobbin@...> wrote:
              > On 01/03/2013 02:15 AM, lei yang wrote:
              >
              >> Hi experts,
              >>
              >> I know in one text,we can use "yy"  to copy something to another place
              >> in text, if I can't to copy something to another place, eg: from a
              >> text,and copy  something using vim, and paste( we don't need to use
              >> vim) something  to another place, how could I do? the real question is
              >> how chould I put something to the vim chipboard. and it can paste to
              >> another place( doc, terminal)
              >
              > I use these mappings to make copy & paste easier:
              >
              > '"Yank content in OS's clipboard
              > vnoremap <leader>yo "*y
              > "Paste content from OS's clipboard
              > nnoremap <leader>po "*p'
              >

              I tried many times.My  vim is built in +chipboard
              question:
              1)"  ---> press shift+" ? to get " ?
              2)"*y, need press at the same time?
              3)how could I select the content I want to copy? can you give me a
              whole process about this ?

              Thanks
              Lei



              hi Lei,

              1) juste as you would write a double quote normally. On my swiss keyboard that would be Shift + the key where I have 2, " and @.

              2) press ", * and y one after the other

              3) you can visually select the content you want to copy.
              For example, in normal mode, if your cursor is on the line you want to copy, pressing V will visually select the line.
              Vj will select the line and the following line. V} will select the line and the following lines in the paragraph.
              If you want to select a word, if your cursor is on the first letter, typing vw will visually select the word.
              If you have mouse support you can also select with the mouse.


              nico



               
              > For this to work in console Vim, Vim would have to be complied
              > +clipboard as has been mentioned. If it has, these would need to be
              > appended to your ~/.vimrc.
              >
              > Cheers,
              >
              >   Phil...
              >
              > --
              > currently (ab)using
              > CentOS 5.8 & 6.3, Debian Squeeze & Wheezy, Fedora Beefy & Spherical,
              > Lubuntu 12.10, OS X Snow Leopard & Ubuntu Precise & Quantal
              >
              >
              >
              >

              --
              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
            Your message has been successfully submitted and would be delivered to recipients shortly.