I am using vi editor and I want to do copy operation but unable to do it. When I select the word and right click on it, there is no "copy"option but only "paste" option is there. What is wrong going on here? Is there is any package needs to be installed for vi/vim editor ?
Note :
It could be better to obtain "copy" option on selection for permanent fix but I got solution below i.e.to use yank command . Its is working fine within the file . But if there are 2 files open on separate tabs, I am still unable to copy data from one file to another.
2 Answers
You are mixing up copy/paste in terminal and in vi/vim.
When you mark a word in the terminal, it is automatically copied, never mind if you are in vi or an other app, or just have some output from a command or even text you have written yourself.
In vi you copy with the y (yank) operator:
yycopy whole lineywcopy word (from cursor position til next whitespace.y<space>copy character
And paste with the p and P operators. Read the vi manual page for full documentation.
Also you could maybe use a graphical editor like gedit.
In some terminals you can use for copy:
CTRL SHIFT C
and for paste:
CTRL SHIFT P
1