Skip to content

Instantly share code, notes, and snippets.

@ChengLong
Last active May 22, 2024 06:50
Show Gist options
  • Select an option

  • Save ChengLong/6208775 to your computer and use it in GitHub Desktop.

Select an option

Save ChengLong/6208775 to your computer and use it in GitHub Desktop.
Install YouCompleteMe on Mac OS X

Below are the instructions for installing YouCompleteMe on Mac OS X

Prerequisites

Instructions

  1. brew install cmake
  2. cd ~/.vim/bundle
  3. git clone https://github.com/Valloric/YouCompleteMe.git
  4. mkdir YouCompleteMe/ycmbuild
  5. cd YouCompleteMe/ycmbuild
  6. cmake -G "Unix Makefiles" . ~/.vim/bundle/YouCompleteMe/cpp/
  7. make ycm_core
  8. Restart Vim
  9. Enjoy
@captainviet

Copy link
Copy Markdown

What should I do after step #7? I've make ycm_core successfully, but I don't have autocomplete when I open Vim again.

@gnanakeethan

Copy link
Copy Markdown

How to setup Go Completer?

@DoctorYe

DoctorYe commented Aug 9, 2018

Copy link
Copy Markdown

#6 Should be: cmake -G "Unix Makefiles" . ~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp

@riccardopersiani

riccardopersiani commented Nov 6, 2018

Copy link
Copy Markdown

Hello, I had the following error:

CMake Error: The source directory "~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp" does not appear to contain CMakeLists.txt.

To solve it:

git submodule update --init --recursive

@evgeniygazetdinov

Copy link
Copy Markdown

Hello, I had the following error:

CMake Error: The source directory "~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp" does not appear to contain CMakeLists.txt.

To solve it:

git submodule update --init --recursive

it's doesn't work!

@driprado

Copy link
Copy Markdown

Hello,
Followed the installation through, no errors.
Should it just start suggesting completions when typing on vim?
I'm looking for autocompletion in bash scripts, any tricks to enable it?
Cheers.

@micbou

micbou commented Feb 22, 2019

Copy link
Copy Markdown

These instructions are incorrect and incomplete. Please follow the official ones and if they don't work for you, ask for help on the Gitter room.

@remidinishanth-ntnx

Copy link
Copy Markdown

you need 3.5,3.6 between 3 and 4.
3.5 cd ~/.vim/bundle/YouCompleteMe
3.6 git submodule update --init --recursive

This worked

@llinfeng

llinfeng commented Oct 6, 2019

Copy link
Copy Markdown

I found the following two lines works:

brew install cmake
# Then, find where YouCompleteMe is stored, and simply run the following from the /.../YouCompleteMe directory
./install.py

@bigvoicevoice

Copy link
Copy Markdown

Hello, I had the following error:

CMake Error: The source directory "~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp" does not appear to contain CMakeLists.txt.

To solve it:
git submodule update --init --recursive

it's doesn't work!

It works for me. I think you might pay attention to the dictionary. You might already in the YouCompleteMe, so it will have this error.

@czhcooper

Copy link
Copy Markdown

I had to use
6. cmake -G "Unix Makefiles" . ~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/
but otherwise this worked for me.

This works for me too!

@TzeHimSung

Copy link
Copy Markdown

I had to use
6. cmake -G "Unix Makefiles" . ~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/
but otherwise this worked for me.

This works for me.

@almoorthi

Copy link
Copy Markdown

This is not working on Mac M1 11.6 (also with tabnine/YouCompleteMe). Finally below command worked.
python3 install.py --cmake-path=/opt/homebrew/bin/cmake --system-libclang --all

@gagata

gagata commented Nov 1, 2021

Copy link
Copy Markdown

This is not working on Mac M1 11.6 (also with tabnine/YouCompleteMe). Finally below command worked. python3 install.py --cmake-path=/opt/homebrew/bin/cmake --system-libclang --all

thank you for posting this! this totally makes it work on m1!

@puremourning

Copy link
Copy Markdown

This is not working on Mac M1 11.6 (also with tabnine/YouCompleteMe). Finally below command worked.
python3 install.py --cmake-path=/opt/homebrew/bin/cmake --system-libclang --all

M1 is now supported by ycm. See the official instructions in the README.

The above instructions are incorrect and outdated.

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