Skip to content

Instantly share code, notes, and snippets.

@bobsomers
Last active September 2, 2022 05:09
Show Gist options
  • Save bobsomers/f733711b239d32268cb6dcbd87d44568 to your computer and use it in GitHub Desktop.
Save bobsomers/f733711b239d32268cb6dcbd87d44568 to your computer and use it in GitHub Desktop.
How to Install YouCompleteMe on Apple Silicon (M1 Mac) with C++ and Rust Completion

How to Install YouCompleteMe on Apple Silicon (M1 Mac) with C++ and Rust Completion

First, install native MacVim, Python, and LLVM:

arch -arm64 brew install llvm python macvim

Add configuration in your .vimrc to use Homebrew LLVM's clangd for C++ completion.

let g:ycm_clangd_binary_path='/opt/homebrew/opt/llvm/bin/clangd'

Modify YouCompleteMe to use a newer nightly Rust. The version they are currently shipping is too old. (I'm using vim-plug here, so your path may differ depending on your Vim plugin manager.)

vim ~/.vim/plugged/YouCompleteMe/third_party/ycmd/build.py
# Change the RUST_TOOLCHAIN line to use a newer nightly:
RUST_TOOLCHAIN = 'nightly-2021-03-07'

Finally build/install YouComplete with the clangd and rust completers. Make sure to run this natively with arch -arm64.

cd ~/.vim/plugged/YouCompleteMe/
arch -arm64 python3 ./install.py --clangd-completer --rust-completer

Now celebrate that everything works again. 🥳

@TCoherence
Copy link

That's a GREAT post man! I've been searching for this pinned version for almost 2 hours and you point me out a perfect way!!! Thank you so much!!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment