Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Quickest way to paste block of text into the vi editor from an external source

For instance, copying a configuration section from a web page and then pasting it into a .conf file that you have open in vi.

like image 901
asfsadf Avatar asked Dec 09 '10 19:12

asfsadf


3 Answers

Or if you use the system register, you can paste without being in insert mode:

"*p

This will paste the system's clipboard at the point of the cursor. No insert mode needed.

like image 33
Jordan Parmer Avatar answered Nov 16 '22 02:11

Jordan Parmer


  1. Enter insert mode (Type i)
  2. Type: Ctrl + Shift + v
like image 187
RationalPi Avatar answered Nov 16 '22 01:11

RationalPi


The real answer:

  1. :set paste

  2. Enter Insert Mode: hit i

  3. Paste: Command + v or Control + v

  4. ESC

  5. :set nopaste

like image 33
Arian Faurtosh Avatar answered Nov 16 '22 02:11

Arian Faurtosh