How to install vim with clipboard

When I tried to install vim in Linux (Ubuntu), It’s installed without clipboard support.

When I try brew info vim I can see only --HEAD option.

Is there any way to install vim with clipboard?

You can make a pull request to enable so others can benefit from it.

Clipboard support for vim requires some development X11 libraries, also you need to build it with --with-x.

It may be possible to use the Wayland clipboard rather than the X11 clipboard. Google wayland clipboard vim.

Thank you it’s works for me.

  1. Install this utility: wl-clipboard
  2. I added this lines to my .vimrc
     xnoremap y y:call system("wl-copy", @")<cr>
     nnoremap p :let @"=substitute(system("wl-paste --no-newline"), '<C-v><C-m>', '', 'g')<cr>p

To copy to clipboard select+y, to past p.

I don’t have any experience in creating brew packages. I will take a look at the vim package script and see what I can do.

We all start without experience but trust me, it’s pretty easy.