Live data from Hacker News

YouCompleteMe - A code-completion engine for Vim

valloric.github.io

31–40 of 78 posts

Re: YouCompleteMe - A code-completion engine for Vim

#31
post #9

How the hell is that a "super-quick installation" for Mac OS? Can anyone figure out an actually quick way to install it with Pathogen? PS: the plugin looks great - I'm just bitching about the installation docs because I'm in the middle of 10 different things at the moment and don't have the time to engage in a potential yak shaving expedition...

1. brew install vim cmake 2. git clone https://github.com/Valloric/YouCompleteMe.git ~/.vim/bundle/YouCompleteMe 3. cd ~/.vim/bundle/YouCompleteMe 4. ./install.sh --clang-completer

[deleted]

Re: YouCompleteMe - A code-completion engine for Vim

#32
post #9

How the hell is that a "super-quick installation" for Mac OS? Can anyone figure out an actually quick way to install it with Pathogen? PS: the plugin looks great - I'm just bitching about the installation docs because I'm in the middle of 10 different things at the moment and don't have the time to engage in a potential yak shaving expedition...

1. brew install vim cmake 2. git clone https://github.com/Valloric/YouCompleteMe.git ~/.vim/bundle/YouCompleteMe 3. cd ~/.vim/bundle/YouCompleteMe 4. ./install.sh --clang-completer

I already have the latest version of cmake installed via homebrew.

The problem appeared to be that YCM's install.sh script goes out of its way to determine the active version of python and link against its libraries[1].

For anyone with python installed via homebrew, that means it links to 2.7.3. Unfortunately, both MacVim and the homebrew version of vim link against the system python (2.7.2). As a result, loading YCM triggers an error resolving urandom and crashes vim.

[1] https://github.com/Valloric/YouCompleteMe/blob/master/instal...

Re: YouCompleteMe - A code-completion engine for Vim

#33
post #12
post #9

How the hell is that a "super-quick installation" for Mac OS? Can anyone figure out an actually quick way to install it with Pathogen? PS: the plugin looks great - I'm just bitching about the installation docs because I'm in the middle of 10 different things at the moment and don't have the time to engage in a potential yak shaving expedition...

But you had plenty of time to bitch about it? ;-) Edit: It suddenly occurred to me just how reliant everyone now is on package managers. Once upon a time, I would think installing a dependency or two before compiling a new toy commonplace, if not expected. Nowadays... it's yak shaving. Not that I'm no less guilty of this. I've even downloaded AUR helper tools because I'm too lazy to even wget a package and do a makep…

The yak shaving part is not the steps described, but the steps not described that will end up being required.

Where you follow the given steps carefully and one fails because whichever version of something is not the right one, then you end up in a weird state where you have a hard time going back to how your setup was before, and you have to google things like "Compiler error: missing dependency foo.h" even though you can see that foo.h is right there. You then finally fixed the foo.h error to discover that you need to update Ruby for whatever reason, but the system doesn't pick up the version you installed with Homebrew anymore but is using the old default one, you then start updating Homebrew. Etc., etc. until you don't even know what you were trying to achieve in the first place and you are now super irritable.

(yes, I had a recent experience with that kind of yak shaving :))

Re: YouCompleteMe - A code-completion engine for Vim

#34
post #28

I use this with Eclim to enhance java writing. The Vrapper plugin for Eclipse is getting very good, but sometimes it's nice to work directly in vim.

I've never gotten eclim to fully work before. I don't do a lot of java nowadays but I just got back into a project where parts of the codebase are in java. So I might try it once again. What has your experience been so far?

[deleted]

Re: YouCompleteMe - A code-completion engine for Vim

#35
This takes "super-quick installation" to a new level...

* compile Vim from source

* install and understand Vundle

* depending on some library issues maybe recompile ycm

* Install development tools and CMake

* Make sure you have Python headers installed

How is the usual "unzip it to ~/.vim" installation called these days?

Re: YouCompleteMe - A code-completion engine for Vim

#36
post #19
post #9

How the hell is that a "super-quick installation" for Mac OS? Can anyone figure out an actually quick way to install it with Pathogen? PS: the plugin looks great - I'm just bitching about the installation docs because I'm in the middle of 10 different things at the moment and don't have the time to engage in a potential yak shaving expedition...

Ditto. Here was my "super-quick installation" experience on OS X: 1. Read through the full page of installation instructions. 2. Update to latest version of MacVim. 3. Go research Vundle because up until now, I've been happily using Pathogen. Install Vundle. 4. Update vimrc file for Vundle, add YCM. 5. Launch vim, note error saying YCM needs installation. 6. Run :BundleInstall, which tells me I should compile and imp…

> 9. Launch vim, which immediately crashes with error: Vim: Caught deadly signal ABRT

Had the same problem. There's something about this in the FAQ: One should delete and re-install python if it was installed through brew. (Doing this and recompiling YCM worked for me.)

The other gripe was: "Add YCM to vundle" ... without any mention of what exactly to add.

Then the thing started complaining about the missing .extra_ycm_something.py ...

Re: YouCompleteMe - A code-completion engine for Vim

#37

This takes "super-quick installation" to a new level... * compile Vim from source * install and understand Vundle * depending on some library issues maybe recompile ycm * Install development tools and CMake * Make sure you have Python headers installed How is the usual "unzip it to ~/.vim" installation called these days?

YouCompleteMe has an unusually complex installation. These days most vim plugins allow you to simply:

  cd ~/.vim/bundle
  git clone ....
and you are good to go. YouCompleteMe isn't this nice, and suffers for it I think. The "unzip it to ~/.vim" is usually called "a real pain in the ass to keep up to date and disabled or uninstall."

Re: YouCompleteMe - A code-completion engine for Vim

#39

Sadly, it is still not working too well with Objective-C, which is currently my main language (1). Luckily, unofficial VIM plugins for XCode like XVim (2) or VIEmu (3) are getting better and better, so at least I can use vim bindings for objective-c now, too. Nevertheless, good clang support in Vim would still be great, so that I could tap into the huge amount of vim plugins during objc development. [1] https://githu…

Better Objective-C triggering support (the issue you linked to) is coming soon.

Re: YouCompleteMe - A code-completion engine for Vim

#40
I'm the main YCM developer.

Most complaints here are about the installation procedure. I tried to make it as easy as possible, but the root of the problem is that you _have to_ compile the ycm_core module so that completion is fast. There's no going around it. The compiled module is the main reason why YCM is so fast when you get it configured.

Other than complicated/rare configurations, installing YCM is IMO not that difficult. The _only_ difference between installing any "average" plugin with Vundle/Pathogen and YCM is running ./install.sh from the YCM directory after you pull it in. That's it. The script will download dependencies for you (libclang), run cmake, make and all the other tools so that everything is installed correctly. It will clean up after itself too. It's pretty hand-holdy so it will tell you if you need to install something (like CMake).

The docs are pretty extensive so you should not get stuck anywhere even if you encounter problems.

I'm happy to hear suggestions on how to further improve the installation procedure. As always, pull requests are welcome too.

YCM too goes out of its way to inform you if you missed something you needed to do, like create a ycm_extra_conf.py file with your build flags (if you want the C-family semantic completion to work) because YCM can't conjure out of the air all the include paths and such needed to compile your project. There's no going around this, a real compiler is used to build the AST so we need the compiler flags.

All in all, if the installation procedure is the main complaint, I'm happy (not really, but you get the point) because that means that actually _using_ the plugin is a good experience (I hope). The installation you go through once and forget about; you use the plugin every day.

Here are excerpts from the FAQ about some of the other things people have brought up:

# Why isn't YCM just written in plain VimScript, FFS?

Because of the identifier completion engine and subsequence-based filtering. Let's say you have many dozens of files open in a single Vim instance (I often do); the identifier-based engine then needs to store thousands (if not tens of thousands) of identifiers in its internal data-structures. When the user types, YCM needs to perform subsequence-based filtering on all of those identifiers (every single one!) in less than 10 milliseconds.

I'm sorry, but that level of performance is just plain impossible to achieve with VimScript. I've tried, and the language is just too slow. No, you can't get acceptable performance even if you limit yourself to just the identifiers in the current file and simple prefix-based fitering.

# Why does YCM demand such a recent version of Vim?

During YCM's development several show-stopper bugs were encountered in Vim. Those needed to be fixed upstream (and were). A few months after those bugs were fixed, Vim trunk landed the pyeval() function which improved YCM performance even more since less time was spent serializing and deserializing data between Vim and the embedded Python interpreter. A few critical bugfixes for pyeval() landed in Vim 7.3.584 (and a few commits before that).

Post reply on HN