How to copy paste vim content to system clipboard
September 12, 2017 · 2 mins read
Hello folks, Today I am going to share the solution for the problem which I was facing for a long time. I have been using Vim editor from a long time now. With Vim we can work on our things without other interruptions. In other words it is the tool for increasing the productivity of the developer. If you haven’t heard about Vim. Here are some relevant content about Vim which you can read to get more insight of the great text editor.
The Problem: How to copy paste content in vim
The solutionNow that we have shared the problem, it’s time to share the solution. First of all, we should know whether our code editor can simply do the things that we want it to do or not. For that apply the following command while using the vim in the escape/command mode.
If the result is 1, then there is no need to do anything. Just apply the following command in Vim or put it into ~/.vimrc.
And use the following set of keys to paste the copied stuff to the text editor.
Press all those keys, one after the other in the escape mode. On the other hand, if the result was 0 apply the following command to get the vim having the clipboard in the bash shell.
Now you can confirm that you have the got the clipboard feature to the Vim. Just open the vim and apply the echo command discussed earlier. After this follow the same procedure which must be followed if we have received 1 as the solution.
$ sudo apt-get install vim-gtk
The Why?These type of things happen with Vim as it has its own clipboard and you cannot even share text between two different instances of terminal. To overcome this problem, this solution is devised. Here is the source which answered the same question. The following link gave the full insight on how to solve the problem and know why it’s happening in this way. Any question, Please feel free to contact.
Please share your Feedback:
Did you enjoy reading or think it can be improved? Don’t forget to leave your thoughts in the comments section below! If you liked this article, please share it with your friends, and read a few more!