Skip to content

Instantly share code, notes, and snippets.

@ChengLong
Last active May 22, 2024 06:50
Show Gist options
  • Save ChengLong/6208775 to your computer and use it in GitHub Desktop.
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
@RyanCarey
Copy link

RyanCarey commented Mar 13, 2018

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

@Mtax
Copy link

Mtax commented Apr 28, 2018

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

@davidajacobus
Copy link

@RyanCarey is correct on #6 @

@captainviet
Copy link

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

How to setup Go Completer?

@DoctorYe
Copy link

DoctorYe commented Aug 9, 2018

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

@riccardopersiani
Copy link

riccardopersiani commented Nov 6, 2018

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

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

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
Copy link

micbou commented Feb 22, 2019

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

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
Copy link

llinfeng commented Oct 6, 2019

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

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

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

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

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
Copy link

gagata commented Nov 1, 2021

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

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