0

I've copied 9 lines from a PDF, and I want to past it in Vim. Could anyone be able to tell how to do it?

Thanks in advance!

5
  • 2
    Please don't cross post questions. You should delete this question and hope for an answer on the other one, since this question is more suited for that site anyway.
    – DJMcMayhem
    Dec 22, 2016 at 23:31
  • Sorry, I'll delete the other one and wait for an answer here.
    – user597313
    Dec 22, 2016 at 23:32
  • Personally, I'd recommend the other way around.
    – DJMcMayhem
    Dec 22, 2016 at 23:33
  • Personnally, I'd prefer to keep this question here.
    – user597313
    Dec 22, 2016 at 23:34
  • @DJMcMayhem very little difference :) The dupe that David suggests has an answer by me which borrows from an answer on Vi and Vim. :D
    – muru
    Dec 23, 2016 at 5:02

2 Answers 2

1

There are few options that you can use if you have highlighted the text in the pdf viewer you can do it with middle click of your mouse!

You can also try "+p or "*p this should also paste content of clipboard! check this out for more information:

pasting registers in vim

1

Press i to go into insert mode and press Ctrl+Shift+v to paste

2
  • @DavidFoerster Hmmm , I think the suggested duplicate is slightly different: that one asks to copy from vim to clipboard, this one asks to copy from clipboard to vim. Also my answer there is different,too, it uses xclip , this one just standard keyboard shortcuts. But still, good job finding that one , it might be useful for other users who come accross it :3 Dec 23, 2016 at 1:33
  • 1
    Be careful with Ctrl-Shift-V. If indentation is enabled, the copied text will be indented unlike with "+p or "+-y. You should do :set paste if you want to safely copy stuff as-is with C-S-v
    – muru
    Dec 23, 2016 at 5:13