Linger clipboard materials in vi

If I intend to replicate message from a documents in vi to an additional documents, I need to highlight the message, Control-Shift-C it, gave up the first documents, open the 2nd, and afterwards paste it using Control-Shift-V. It seems like there have to be a less complicated means to do this - that is, key-board regulates just. Any kind of pointers?

0
2019-05-06 21:57:33
Source Share
Answers: 3

While editing and enhancing a documents you can make use of :e filename to open an additional documents and also :rew to go back to the initial documents similar to this :

  1. open initial documents vi foo
  2. tug message as an example yy (tug a line)
  3. open a 2nd documents to modify ESC :e bar
  4. place your message p (after that conserve :w)
  5. return to the first documents ESC :rew
0
2019-05-08 20:06:55
Source

vim can be set up with X clipboard assistance. Pass - - with - x = yes to set up if your circulation does not pack vim with X assistance. By default the X clipboard is readily available as the * barrier and also the X reduced board (option) is readily available as the" barrier, so picking an area and also keying "+y will certainly tug the option to the X reduced board, and also "*y will certainly tug to the X clipboard. In a similar way, "*p will certainly paste from the X clipboard and also "+p from the X option.

You can set the default (confidential) barrier in vim to be the X clipboard by running set clipboard=unnamed. After that you can simply y and also p from the X clipboard straight.

0
2019-05-08 20:05:35
Source

Sure :

  1. Open your documents : vi foo
  2. In your documents, open the 2nd : ESC :open bar
  3. Return to the first : ESC :prev
  4. To replicate the web content of the documents : ESC :1,$ y
  5. To go the next documents : ESC :n
  6. Paste it : ESC p

Maybe there's a much shorter means?

0
2019-05-08 18:27:07
Source