Find the answer to your Linux question:
Results 1 to 4 of 4
I am using vim as a text editor. I have problems when I trying to copy something from another source (i.e. a web page), and then paste it in the ...
  1. #1
    Just Joined!
    Join Date
    Sep 2008
    Posts
    32

    Problems with copying and pasting with vim

    I am using vim as a text editor. I have problems when I trying to copy something from another source (i.e. a web page), and then paste it in the document, which I have opened with vim. It doesn't work.
    I also cannot copy copy something from the document opened with vim, and then paste it somewhere else, i.e. in my email. I am doing this with the vim commands yy and p. "Copy" and "paste" with the right-mouse-click doesn't work.
    Could give me a clue how I can copy and paste in/from vim as with other editors such as Word (Microsoft) or Emacs.
    Thanks a lot!

  2. #2
    Trusted Penguin elija's Avatar
    Join Date
    Jul 2004
    Location
    Either at home or at work or down the pub
    Posts
    2,298
    It may or may not be possible depending on your version of vim and how it was compiled.

    First of all run "vim --version" (no quotes)
    Look in the text produced, if you see +xterm_clipboard then the following should work, if you see -xterm_clipboard, it won't and you will need to find a version compiled with clipboard support or recompile your own!

    Assuming you have support

    "+yy or "*yy to copy to clipboard
    "+p or "*p to paste from clipboard

    in the above vim commands the " is needed
    If we hit that bullseye, the rest of the dominoes will fall like a house of cards. Checkmate! (Zapp Brannigan)


    My new blog. It's probably not as good as I think it is.

  3. #3
    Just Joined!
    Join Date
    Sep 2008
    Posts
    32
    Thanks a lot for the reply!

    Yes, when I typed "vim --version", I have seen that I have -xterm_clipboard.

    However, I cannot understand your second lines about yy and p: do I have to see these "+yy, "*yy, "+p or "*p somewhere, i.e. in the output of "vim --version" ? I don't see them.
    I can use the commands yy, nyy (n for the number of lines), and p without problems when I am using them only in the current open file with vim.

    I have also two questions about -xterm_clipboard:
    1. How do I know whether the version has +xterm_clipboard before I install it and be able to check that with "vim --version" ?
    2. How can I compile/recompile a version on my own ? (I would like to know that. If it is too long to explain this, do you know some tutorial for that ?)

    Thank you.

  4. #4
    Trusted Penguin elija's Avatar
    Join Date
    Jul 2004
    Location
    Either at home or at work or down the pub
    Posts
    2,298
    -xterm_clipboard means that you wont be able to copy and paste from the clipboard without having a version of vim specifically compiled for it.

    The commands I gave are vim commands, you type them in the editor itself, however you don't have clipboard support so they wont work anyway.

    Have a look at welcome home : vim online to get the latest version, sources and specific help
    If we hit that bullseye, the rest of the dominoes will fall like a house of cards. Checkmate! (Zapp Brannigan)


    My new blog. It's probably not as good as I think it is.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...