My goal is to yank a line in the shell (for example with yy) into the system clipboard and then paste it somewhere else (for example in the internet browser). How can I accomplish that?
The simplest way to get the end result you want (pasting code from shell to internet broswer) is to:
- Select the text with your mouse cursor
Ctrl+Vto paste outside of terminal
Ctrl+Shift+Vto paste into a terminal prompt
Your vim need have +xterm_clipboard flag, you can check this with
vim --version | grep +xterm_clipboard. If your vim isn’t compiled with this flag, you can compile it yourself or try to install gvim (usually it comes with this flag).
For access to the system clipboard you have to type those sequences:
- Copy (a word):