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...
6. Run :BundleInstall, which tells me I should compile and impolitely adding "Read the docs!" (Which docs? The GitHub docs, which tell me I should only need to recompile in rare cases? Or the bundle's vim docs, which didn't exist on my system prior to running this command?)
7. Back to terminal, launch ./install.sh --clang-completer in the YCM directory.
8. Go fix breakfast, return. Compilation eventually completes, no errors.
9. Launch vim, which immediately crashes with error: Vim: Caught deadly signal ABRT
10. Give up and delete any trace of YCM.
In a perfect world maybe I would have an extra hour or two to debug this, run through some regressions but right now I don't. Sounds like a nice plugin, maybe I'll try again in the future.
> 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 ...
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.
That likely means your PATH is out of order, if ordered correctly /usr/local/bin should override /usr/bin. Can save you needing to do that in the future.
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 makepkg any longer.
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 :))
I'm pretty sure you can install it with Pathogen as normal. There are just two other points: (1) make sure you have the latest version of vim; (2) you just need to run an install script to finalize it. The script is in the bundle folder you create when cloning the git repo.
You better thank your lucky stars you aren't installing on Windows! Took me many days of tinkering to get this working correctly with clang support, and its still not all the way there yet.
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."
YouCompleteMe is included with subvim[0], which I have found to be a great flavor of vim. I just forked subvim and tweaked it how I liked from there. Which gets around the painful install of YCM.
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).
Couldn't you ship a several already compiled binaries for major OSes? What do you do during compilation (and do you have to do this during compilation instead of on runtime) that makes it impossible?
I'm not using VIM anymore, so the question is just at out of curiosity :)
Indeed, and if it's about saving on duplicating libraries, that's less important to me than saving on installation time. I don't care if it loads up 20 megs of duplicated libraries because you had to hard-link them in. I have loads of RAM, very little time to set things up.
Anyone know of a tool or system out there that automates the creation of binaries for several systems and then adds them to a key-value file with arch : binary_file_name pairs that can be consumed by an install script or curl pipe to shell install.
Are you familiar with NeoBundle? It's mostly a drop-in replacement for Vundle, but it has support for post-installation hooks. This could potentially make it a one-step install (assuming NeoBundle was already installed).
I use NeoBundle to run the YouCompleteMe module build upon installation. Works great. Especially since the build is triggered by a single simple command. (People really complain about that being hard?)
Yeah I don't get it - I had zero issues with installation (and I usually find a way to screw everything up). Can you post your YouCompleteMe install block for NeoBundle?
"Super-quick" was intended to be a bit tongue-in-cheek, although compared to the Full Installation Guide (it's in the docs), trust me, the "super-quick" installation really is super-quick.
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.
Except, I don't. I haven't installed it because I have a feeling this will be way more hassle than it looks (a feeling validated by several comments in this thread) and I don't have the time to do that kind of stuff.
Please let us know when installation is less of a kluge.
I followed your full install directions to a T and I'm getting "YouCompleteMe unavailable: ycm_core too old, PLEASE RECOMPILE ycm_core" on Vim start-up. This doesn't appear to be a Python version issue (everything is showing 2.7) and I downloaded the Clang binaries as directed.
To be honest, I found it completely reasonable, and as quick as a compilation step could be. I didn't install it yet due to the new Vim version dependency, but I will as soon as I get the new Vim version.
So I cloned the repo, ran install.sh and got prompted to run the git submodule checkout for jedi the first time I opened a python file.
Seems like a pretty excellent installation process (on linux anyway) despite the "hackers" complaining in other comment threads.
But the important part is that I'm really impressed by the completion ability, I've only played with it a bit but I'm leaving the rest of my plugins for that turned off and staying with ycm for now. Excellent plugin, thank you!
> So I cloned the repo, ran install.sh and got prompted to run the git submodule checkout for jedi the first time I opened a python file.
Yep, I added that check to better support the use case of people checking out the repo themselves instead of using Vundle (which will checkout the git submodules for you automatically).
I agree. I've used both AutoComplPop and NeoComplCache extensively (1-2 years each) and YCM is superior to both in terms of speed. NeoComplCache has great completion ability, but it lacks fuzzy matching, and the configuration was a total rat's nest. I've been using YCM for like 2 months and I haven't looked back.
I've been using this for Python development for a few months now and it's by far the best completion solution I've found in vim and I've tried most. Jedi by itself is great but the actual interface to it was always lacking and YCM's fuzzy matching makes it breeze.
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.
you might want to consider clang_complete with ultisnips. it generates tab triggers for objective-c methods.
i tried to add that functionality to youcompleteme, but the main problem with it is that youcompleteme tries to be very generic in completions, therefore there is no real way of knowing what kind of methods you get back from your completion backend. you could hack it to do some regex parsing on method names, but i'd really suggest that if objective-c is your main target go for clangcomplete+ultisnips.
I've been using YCM for a few months now and I love it. It's a big part of my coding experience now. It's a bit of a pain to get a supported vim version up and running, but completely worth it.
If you are a ruby or javascript developer, just use Supertab, because you will waste more time installing it than getting any substantial benefits over default vim completion.
How do you achieve completion in Ruby with vim? I'd be interested cause the only things doing completion I've seen for vim so far are always extremely limited (completion on stuff you have in your buffer).
I could not install it in my work machine as the OS is windows. As a replacement I use neocomplete.vim[1]. It is very fast, responsive, has fuzzy auto-complete. But it requires vim version greater than 7.3.885 and vim compiled with lua bindings. Still it is small annoyance compared to YCM installation procedure.
neocomplete is also my preferred autocomplete plugin. it integrates very well with all of shougo's other plugins, and it works on windows. YCM officially does not support windows and it's not uncommon for it to be broken for a week or two.
This is an absolutely fantastic plugin. The minor installation pain is paid back easily after a few hours of use. Fast, fuzzy matching autocomplete people!!
My only issue with installation was that I would prefer to actually upgrade my systems clang, instead of just installing it in my home dir, and there aren't step by step instructions for doing so.
Once it is installed it is great for C lang stuff and python. It makes me wish other languages had equally good support you could integrate. Perl omni complete is super slow for example. But I know that isn't you.
Could not get it to install on Debian. Depends on newer libs than found on conservative Wheezy. Mac was easier but still somewhat arduous. It's necessary complex to install because he's using C++ to get the speed boost. VimScript was too slow.
I highly recommend this plugin! I find it really snappy on my projects.
I haven't had the opportunity to try it on any gigantic projects, but I have found configuration files for YCM in the Chromium source tree which suggests that it scales nicely (assuming it's usable on the Chromium tree).
I haven't tried it on anything but rather small projects in C: 10-15 source files/modules, but I prefer vim and ycm to XCode for coding. As a matter of fact, all other code completion thingy's I use seem a bit crappy in comparision, with the excempt of bbautocomplete.
Time to install the new beta of vim, and check out ycm! :)
Easy to install actually. Worked pretty much out of the box for me. Does anyone know how to change the autocompletion popup background color? A black popup window on black background make things a little harder to read.
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?
So, after building vim from source, python from source, and cmake from source (damn old repos...), I'm finally getting stuff to build. and I hit this:
Linking CXX static library libBoostParts.a
[ 89%] Built target BoostParts
Scanning dependencies of target ycm_core
[ 90%] [ 92%] Building CXX object ycm/CMakeFiles/ycm_core.dir/LetterNode.cpp.o
Building CXX object ycm/CMakeFiles/ycm_core.dir/Utils.cpp.o
[ 93%] Building CXX object ycm/CMakeFiles/ycm_core.dir/ycm_core.cpp.o
[ 93%] Building CXX object ycm/CMakeFiles/ycm_core.dir/Candidate.cpp.o
[ 94%] Building CXX object ycm/CMakeFiles/ycm_core.dir/PythonSupport.cpp.o
cc1plus: warnings being treated as errors
/home/zdrillings/.vim/bundle/YouCompleteMe/cpp/BoostParts/boost/python/converter/pyobject_type.hpp: In static member function ‘static bool boost::python::converter::pyobject_type<Object, pytype>::check(PyObject) [with Object = boost::python::list, PyTypeObject pytype = (& PyList_Type)]’:
/home/zdrillings/.vim/bundle/YouCompleteMe/cpp/BoostParts/boost/python/converter/obj_mgr_arg_from_python.hpp:101: instantiated from ‘bool boost::python::converter::detail::object_manager_ref_check(const T&) [with T = boost::python::list]’
/home/zdrillings/.vim/bundle/YouCompleteMe/cpp/BoostParts/boost/python/converter/obj_mgr_arg_from_python.hpp:109: instantiated from ‘bool boost::python::converter::object_manager_ref_arg_from_python<Ref>::convertible() const [with Ref = const boost::python::list&]’
/home/zdrillings/.vim/bundle/YouCompleteMe/cpp/BoostParts/boost/preprocessor/iteration/detail/local.hpp:34: instantiated from ‘PyObject* boost::python::detail::caller_arity<3u>::impl<F, Policies, Sig>::operator()(PyObject, PyObject) [with F = boost::python::list ()(const boost::python::list&, const std::string&, const std::string&), Policies = boost::python::default_call_policies, Sig = boost::mpl::vector4<boost::python::list, const boost::python::list&, const std::string&, const std::string&>]’
/home/zdrillings/.vim/bundle/YouCompleteMe/cpp/BoostParts/boost/python/object/py_function.hpp:38: instantiated from ‘PyObject boost::python::objects::caller_py_function_impl<Caller>::operator()(PyObject, PyObject) [with Caller = boost::python::detail::caller<boost::python::list ()(const boost::python::list&, const std::string&, const std::string&), boost::python::default_call_policies, boost::mpl::vector4<boost::python::list, const boost::python::list&, const std::string&, const std::string&> >]’
/home/zdrillings/.vim/bundle/YouCompleteMe/cpp/ycm/ycm_core.cpp:186: instantiated from here
/home/zdrillings/.vim/bundle/YouCompleteMe/cpp/BoostParts/boost/python/converter/pyobject_type.hpp:21: warning: dereferencing type-punned pointer will break strict-aliasing rules
make[3]: [ycm/CMakeFiles/ycm_core.dir/ycm_core.cpp.o] Error 1
make[3]: * Waiting for unfinished jobs....
make[2]: * [ycm/CMakeFiles/ycm_core.dir/all] Error 2
make[1]: * [ycm/CMakeFiles/ycm_core.dir/rule] Error 2
make: * [ycm_core] Error 2
Now, I went in and removed the -Werror flag from the makefiles and that got around it, but I get a ton of errors when i start vim, doing that:
Error detected while processing function youcompleteme#Enable:
line 11:
Traceback (most recent call last):
Press ENTER or type command to continue
Error detected while processing function youcompleteme#Enable:
line 11:
File "<string>", line 1, in ?
Press ENTER or type command to continue
Error detected while processing function youcompleteme#Enable:
line 11:
File "/home/zdrillings/.vim/bundle/YouCompleteMe/autoload/../python/ycm/base.py", line 28
Press ENTER or type command to continue
Error detected while processing function youcompleteme#Enable:
line 11:
except ImportError as e:
Press ENTER or type command to continue
Error detected while processing function youcompleteme#Enable:
line 11:
^
Press ENTER or type command to continue
Error detected while processing function youcompleteme#Enable:
line 11:
SyntaxError: invalid syntax
Press ENTER or type command to continue
Error detected while processing function youcompleteme#Enable:
line 13:
Traceback (most recent call last):
Press ENTER or type command to continue
Error detected while processing function youcompleteme#Enable:
line 13:
File "<string>", line 0, in ?
Press ENTER or type command to continue
Error detected while processing function youcompleteme#Enable:
line 13:
NameError: name 'base' is not defined
Press ENTER or type command to continue
Error detected while processing function youcompleteme#Enable:
line 13:
E858: Eval did not return a valid python object
Press ENTER or type command to continue
YouCompleteMe unavailable: ycm_core too old, PLEASE RECOMPILE ycm_core
I'm guessing it's related. Does anyone have any advice on fixing some of this, so I can try this plugin? it sounds fantastic.
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...