How do you copy something in vi?

How do you copy something in vi?
Answer
To copy to clipboard, do ” + y and [movement]. So, g g ” + y G will copy the whole file. Another easy way to copy the entire file if you’re having problems using VI, is just by typing “cat filename”. It will echo the file to screen and then you can just scroll up and down and copy/paste.
 

Tìm kiếm

Back
Top