News for hackers. Stuff that matters.
Re:YouCompleteMe, a Fast, As-You-Type, Fuzzy-Search Code Com... by dsrguru on Tuesday February 05, 2013 @02:09AM (#5169564)
How to install (at least on Linux):

1. Install the Vundle plugin manager for Vim.

2. Add the line "Bundle 'Valloric/YouCompleteMe'" (without the double quotes) to your ~/.vimrc file.

3. Open Vim and run ":BundleInstall" without the quotes.

4. Install cmake if it's not already installed. In a temporary directory, run "cmake -G 'Unix Makefiles' . ~/.vim/bundle/YouCompleteMe/cpp" (without the quotes) to generate a Makefile and then run "make ycm_core" to build.

5. Open a file in Vim and start typing.

Re:YouCompleteMe, a Fast, As-You-Type, Fuzzy-Search Code Com... by justsee on Tuesday February 05, 2013 @02:16AM (#5169588)
It depends on MacVim on OS X.

So for terminal Vim'ers:

1. copy the mvim script from MacVim to /usr/local/bin (or wherever)

2. ln -s /usr/local/bin/mvim vim (assuming you've ditched your old vim symlink)

Linking directly to the MacVim binary causes these sorts of issues[0].

[0] https://github.com/altercation/solarized/issues/60

Re:YouCompleteMe, a Fast, As-You-Type, Fuzzy-Search Code Com... by syncontrol on Tuesday February 05, 2013 @02:23AM (#5169609)
It doesn't really depend on MacVim, that's just a binary distribution of Vim for Macs that is proven to work.

Vim from Homebrew doesn't work though, something is wrong with the way Homebrew configures/builds Vim (don't know what though).

You can certainly build a Vim from source for Mac and have that work well with YCM, the only question is why would someone go through the trouble of doing so when MacVim does it for you.

Even if you prefer using Vim in the console and don't like the GUI, MacVim.app has a normal Vim binary inside it that you can call.

Re:YouCompleteMe, a Fast, As-You-Type, Fuzzy-Search Code Com... by danneu on Tuesday February 05, 2013 @04:20PM (#5173279)
Vim from Homebrew + YouCompleteMe works for me.

* brew install vim

* alias vim="/usr/local/Cellar/vim/7.3.632/bin/vim"

* :BundleInstall 'Valloric/YouCompleteMe'

* Make the ycm_build directory:

    cd ~
    mkdir ycm_build
    cd ycm_build
* brew install cmake

* Run cmake from the ycm_build dir:

    cmake -G "Unix Makefiles" . ~/.vim/bundle/YouCompleteMe/cpp
* make ycm_core

And boom, YouCompleteMe is running for me.

Works amazing. Always had a problem with having to press a button to autocomplete. The cognitive reflection of "okay, I want help completing this word" usually defeats the speed improvement for me.

Re:YouCompleteMe, a Fast, As-You-Type, Fuzzy-Search Code Com... by justsee on Tuesday February 05, 2013 @02:51AM (#5169665)
> It doesn't really depend on MacVim, that's just a binary distribution of Vim for Macs that is proven to work.

Ah okay - the README gave me a very different impression. Either way using the packaged MacVim binary via the mvim script is preferable, for reasons you've elaborated on.

> why would someone go through the trouble of doing so when MacVim does it for you.

Commandline lovers love trouble, are often not found browsing .dmg offerings?

Re:YouCompleteMe, a Fast, As-You-Type, Fuzzy-Search Code Com... by derekprior on Tuesday February 05, 2013 @03:47PM (#5173126)
homebrew-built vim worked fine for me. I followed the manual steps.
Re:YouCompleteMe, a Fast, As-You-Type, Fuzzy-Search Code Com... by johncoltrane on Tuesday February 05, 2013 @03:39AM (#5169763)
No, don't make a symlink. A simple alias is less obstrusive:

    alias vim='/path/to/mvim -v'
Re:YouCompleteMe, a Fast, As-You-Type, Fuzzy-Search Code Com... by jlgreco on Tuesday February 05, 2013 @04:39AM (#5169905)
An alias will only work with things that are using your shell with your configuration sourced. Things that merely use your PATH won't pick that up.
Re:YouCompleteMe, a Fast, As-You-Type, Fuzzy-Search Code Com... by johncoltrane on Tuesday February 05, 2013 @05:07AM (#5169965)
For the typical use of Vim, it's perfect:

    $ vim filename
Re:YouCompleteMe, a Fast, As-You-Type, Fuzzy-Search Code Com... by jlgreco on Tuesday February 05, 2013 @10:20AM (#5171046)
It breaks down when you use it in other common ways, like from your git configuration.
Re:YouCompleteMe, a Fast, As-You-Type, Fuzzy-Search Code Com... by johncoltrane on Tuesday February 05, 2013 @10:42AM (#5171186)
You can't use

    vim
anyway in git: you must give it the full path.
Re:YouCompleteMe, a Fast, As-You-Type, Fuzzy-Search Code Com... by jlgreco on Tuesday February 05, 2013 @01:07PM (#5172115)
No, just 'vim' itself is fine, if you have a 'vim' in your PATH.

https://github.com/search?q=%27editor+%3D%27++extension%3A.g...

What I usually do is maintain a set of symlinks in ~/bin/ (which is in my PATH) if they are not already in my PATH (or if I want them to override something else in my PATH, like HEAD builds of various things on occasion), and only use aliases to set default arguments (`ls --color=auto` for example).

Re:YouCompleteMe, a Fast, As-You-Type, Fuzzy-Search Code Com... by johncoltrane on Wednesday February 06, 2013 @03:31AM (#5175474)
No. On Mac OS X, using `vim` generally causes this error:

    error: There was a problem with the editor 'vi'
The full path must be used to get rid of it.
Re:YouCompleteMe, a Fast, As-You-Type, Fuzzy-Search Code Com... by newman314 on Tuesday February 05, 2013 @05:09PM (#5173604)
I do not use home brew or ports so is there any reason that this would not work with the default vim that ships with macos?
Re:YouCompleteMe, a Fast, As-You-Type, Fuzzy-Search Code Com... by abjuk on Wednesday February 06, 2013 @04:17PM (#5178875)
You need at least version 7.3 patch 584, which is fairly recent. You can check with :version.
Re:YouCompleteMe, a Fast, As-You-Type, Fuzzy-Search Code Com... by contingencies on Tuesday February 05, 2013 @06:02PM (#5173881)
Just wrote up Gentoo install at http://pastebin.ca/2311021
Re:YouCompleteMe, a Fast, As-You-Type, Fuzzy-Search Code Com... by contingencies on Tuesday February 05, 2013 @09:23PM (#5174569)
Urk. After using this awhile I don't like the context spam and have disabled it.

Interesting idea, I can see how people in .net who want to look up a little-used Windows API might like to use it being automatic, but the annoyance of the feature outweighs any benefit for my environment.

vi + console + syntax highlighting = my preference. Mind remains uninterrupted, focused, instantly aware of syntax errors, code structure. :)

Re:YouCompleteMe, a Fast, As-You-Type, Fuzzy-Search Code Com... by 11185d on Wednesday February 06, 2013 @03:30AM (#5175470)
newb here, i gotta ask: is there something like this for python/php/non-C languages? something that completes your elements etc..?