[ How To ] Vim with Clipboard Support

On my machine the included vim program did not container clipboard support. This means you cannot yank from vim to the system clipboard and paste. You can tell this by running:
‘vim --version’ and seeing if +clipboard exists. if it’s -clipboard it is not compiled in.

To fix this issue you can build vim from source but first you need a dependency.

sudo swupd bundle-add devpkg-libX11

will install the required X11 headers that Vim wants to link against.

After you have done this simply checkout the vim repository here: https://github.com/vim/
do a fetch of all tags 'git fetch --all --tags`
checkout the tag you’d like to build and then perform a
sudo ./configure && sudo make && sudo make install at the root of the repo.

The resulting vim binary will be in ./src directory. I typically copy this to /usr/local/bin when done.

For this to work I do need to remove the vim in /usr/bin/ - as I understand it upgrades may place this back. Whats a better solution to overwrite binaries in /usr/bin? Maybe change /usr/local/bin to be before /usr/bin in $PATH ?

Using this strategy when I open vim I get the following issue:

_IceTransSocketUNIXConnect: Cannot connect to non-local host clr-c60df0bdf3ec4419afae9ff725b1eee0
_IceTransSocketUNIXConnect: Cannot connect to non-local host clr-c60df0bdf3ec4419afae9ff725b1eee0

it doesn’t stop me from using vim, but not sure why it occurs. any ideas?

Hi @Louis_DeLosSantos
Please read Installing vim in order to enable python and python3
I think this thread can help you

It’s attempting to talk to X11 through a socket - a normal thing. You likely do not have an X server running or are remotely logged into the system.

I am running vim from my terminal emulator in an X11 gnome session.