0

Which commands can you use to take a paragraph from one file and insert it in a second file?

0

You can jump around paragraphs with { }. Yank a paragraph with y}, if you are positioned above the paragraph you want. Then you use :e file2 to open the other file (or whichever method you use to switch between open files). Then p for paste to paste the paragraph.

0
1

You could get a better answer if you'd provided more information. Nonetheless:

  • dap will delete (d) around (a) the current paragraph (p).
  • move to the next buffer (file). E.g. with :bNext.
  • go to where you wanna paste the paragraph. E.g. 21G.
  • paste it with p.

Just provide more information if it is not your usercase. (:

3
  • thank you for your time assisting me! I'm quite new to this; how can I copy one paragraph from current file without deleting it, and past the same paragraph into another file please? Thank You! – Man Apr 21 '17 at 9:35
  • You're welcome. Since you said 'to take a paragraph from one file and insert' I thought you wanted to 'cut it'. If you want just to copy it, substitute dap for yap. If you confirm that it works, I'll be glad to update the answer. (: – lsrdg Apr 21 '17 at 9:40
  • Great. But please, take a look at the moderators note. If possible @Man, update your question explaining what exactely is your problem and situation, then the answer will be updated to answer your problem and also explain the Vim's concepts behing it. – lsrdg Apr 21 '17 at 9:49

Not the answer you're looking for? Browse other questions tagged or ask your own question.