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
This problem faced is very basic and at the same time it is very irritating. We can copy-paste stuff within Vim quite easily by using the visual mode of Vim. But when it comes to pasting some stuff from the browser or some other source, it becomes quite difficult to do that. On my local system when copying stuff from the browser and used to paste in the Vim text editor, the text either got scatter with different indentation. Being a python developer, I don’t like anything which is not properly highlighted.The solution
Now 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.:echo has('clipboard')
:set clipboard=unnamed
"+p
$ 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!