How to install Vim with clipboard on Mojave?

I want to install Vim on my macOS Mojave laptop with Vim clipboard support. I found a couple of articles on the internet that said if I do “brew install vim”, clipboard support (i.e. “+clipboard”) will be compiled in by default. In addition, if I wanted to add X11 clipboard support (i.e “+xterm_clipboard”), I would need to add “–with-client-server” to the system configure section which I did. So I ran “brew update” and the “brew install vim” but I still see that the clipboard and xterm_clipboard features are not enabled. And I also checked that I’m using the newly-installed /usr/local/bin/vim executable before I ran “vim --version.” Are there additional steps I need to take to install Vim with clipboard support? Thanks.

I think you might have had some outdated articles. First step, if you edit the formula you have to run brew install --build-from-source <formula> otherwise you’ll get a precompiled version.

In addition to that, X support on macOS is terrible. For this reason Homebrew rarely ever enables features that require X.