14 ms·
Coc.nvim – Intellisense Engine for Vim8 and Neovim
- danilocesar 8y ago/me looking for comments/comparisons about this from people used with YouCompleteMe, which is, IMO, the best completer for vim today.
- shawxe 8y agoI'd like to see such a comparison too. I've been considering switching to YouCompleteMe from ctags/cscope, but this looks like it might be even nicer, especially since a number of my teammates already use Intellisense with other editors.
- ahallock 8y agoI use TabNine and it's been pretty amazing.
- arendtio 8y agoDo you know how it compares to YouCompleteMe or Coc.vim? Is there something it can do, which the others can't? Do you feel that the suggestions are better? something else?
- ahallock 8y agoI haven't had time to try those two yet. I believe TabNine uses YouCompleteMe internally. There's a discussion here: https://news.ycombinator.com/item?id=18393364 https://news.ycombinator.com/item?id=18393364
- tbodt 8y agoTabNine's selling point (literally, it's $49) is that it uses machine learning to provide completions without having to configure any sort of knowledge about the language you're using.
- wincent 8y agoI used to use YouCompleteMe with Vim, then switched to deoplete on Neovim, because deoplete was easier to extend without having to maintain a fork and the user experience was pretty much the same. I briefly tried out Coc but didn't find it to deliver anything compelling to make me switch away from a relatively fine-tuned deoplete-powered set-up (along with UltiSnips, LanguageClient-neovim, and javascript-typescript-stdio etc). I like the fact that there is competition though and an LSP ecosystem that's getting more and more robust all the time. We finally have multiple high-quality options to bring IDE-like features to Vim.
- chemzqm 8y agoLet me tell you why coc.nvim is created. I used to use deoplete.nvim, LanguageClient-neovim with javascript-typescript-stdio, but they easily broken lots of time everyday and debug the problems is also quite challenging. So I made it to be able to load fork of vscode extension, and coc-tsserver implemented more than 95% features that vscode could provide. It's not easier to switch vim plugins, consider come back when you would like to try out some new features.
- caymanjim 8y agoYouCompleteMe is hopelessly slow even on a beefy computer with a medium-sized code repo, despite configuring and optimizing. It's simply too painful to use. deoplete is significantly faster, but also becomes painfully slow when you have a few hundred files and a few hundred thousand lines of code total. I'll try Coc; hopefully it's fast enough. IntelliSense works great in VS.
- todd3834 8y agoI’m still waiting for a day where I can write Swift and Kotlin with VIM and still be productive. Maybe this will let me do that but after the last few tries I’m not going to get my hopes up.
- yogeshlor 8y agodon't know about swift but any JVM based language will have more productivity in IDE than vim. I have tried really hard to use vim for java and the trouble is not worth it. But for everything else vim is your guy.
- greysonp 8y agoI recommend installing the VIM plugin for IntelliJ. It's pretty good and supports most things in .vimrc's. Best of both worlds, really.
- todd3834 8y agoDoes it support vim plugins?
- NiceGuy_Ty 8y agoI'm a Scala dev using vim as my daily editor, if you're using sbt then you can use ale's sbtserver linter: https://github.com/w0rp/ale/blob/master/doc/ale-scala.txt https://github.com/w0rp/ale/blob/master/doc/ale-scala.txt
- fxfan 8y agoVim needs to come with its own package management and all languages should have a single-script which setup their features. I don't want to install 20 different packages manually and not have them work
- codebase 8y agohttps://vim-bootstrap.com/ https://vim-bootstrap.com/
- johnchristopher 8y agoInteresting. But the PHP/JS/neovim file I got fails to install vim-plug.
- EamonnMR 8y agoThere's Vundle and Pathogen.
- johnchristopher 8y agoNo vundle for this one. Out of curiosity I checked out if Vundle would give me YouCompleteMe but... vundle installation of YouCompleteMe just failed with `The ycmd server SHUT DOWN (restart with ':YcmRestartServer').YCM core library not detected; you need to compile YCM before using it. Follow the instructions in the documentation.`. I love Vim but I have stopped trying to build a cathedral for it.
- fourseventy 8y agovery cool, ill definitely be trying it out. I'm currently using deoplete which is fine but this looks like it could definitely be better!
- ttiurani 8y agoI switched my neovim setup from ale and deoplete to coc.nvim a few months ago, and am thrilled about finally being able to write also all my java with neovim. There are a few rough edges, and of course java features are miles behind IntelliJ, but the benefit of being able to use one editor to rule them all, is a massive productivity boost. Don't think I'll switch back. Also Typescript with a language server is working really well.
- jeremija 8y agoI was a long time YCM user but it seemed to slow down my editor, then I switched to ALE and it was much better. I'm curious to see what improvements CoC brings to the table. From the screencast it looks like it can automatically add import statements to TypeScript projects which would be a huge productivity boost for me!
- daliusd 8y agoTry nvim, deoplete and nvim-typescript. Maybe try importjs as well.
- towb 8y agoThis works really good for TS compared to anything else I've tried. I don't think this is as flexible as some of the alternatives, this one is a bit weird compared to many other vim plugins that I'm used to, but it works pretty much out of the box. Don't forget to install yarn, not super happy about that.
- daliusd 8y agoHave you tried nvim-typescript as well? How it compares?
- swebs 8y agoFrom what I understand, Intellisense is Microsoft's branding for their autocomplete engine. So is this Intellisense™ or a completely separate engine?
- jchw 8y agoIt apparently implements LSP, which is in fact the same protocol Microsoft's VS Code uses to deliver what they call intellisense, and presumably it's possible to use Microsoft LSP servers with it.
- Avi-D-coder 8y agoCoc is derived from a lot of vscode code. It has almost all of same features because it's using some of the same code under the hood.
- oneplane 8y agoI'm also not sure why people keep calling autocomplete "intellisense". Using a brand name in place of the actual name of the feature seems like going a step back to me. We got the correct words, might as well use them.
- sjellis 8y ago"Using a brand name in place of the actual name of the feature seems like going a step back to me." It's a sign of massive success, too. Like "Hoover" now being a synonym for vacuum cleaner.
- oneplane 8y agoWell, yes and no. Hoover means nothing here... That is why brand names as specific names seems like an issue to me; a lot of brands don't exist worldwide.
- dfee 8y agoI’d love to switch back from VSCode to get better (native) vim bindings. However, I like the documentation with auto complete.
- Avi-D-coder 8y agoCoc has floating documentation on neovim. It even highlights code examples.
- mailslot 8y agoI’m going to get heavily downvoted for this, I’m sure, but... If I find myself needing, or even using, code completion, I’ve fucked up my implementation. My interfaces are not intuitive nor consistent... or it’s just glue lacking adequate abstraction. I strongly suggest all developers disable completion & tag jumping, not because I’m an elitist, but because it forces you to write better code. Not a troll. I’m serious. On projects I’ve worked on that started with Intellisense, they quickly evolved into being unmaintainable without it. It’s an asset to skilled hands, but a debilitating crutch for the novice. It’s like never operating a vehicle without a GPS. You never develop certain types of skills.
- cpjk 8y agoTBH I just love auto completion to reduce the amount of typing I need to do.
- jamescostian 8y agoI didn't downvote you because I understand where you're coming from. The APIs you work with probably don't change and you already know most of them, disabling code completion works for you. But if someone renames things in your API, you'll be slower without completion. And if you're working with a new language/framework (or even just a large library), you'll reaaalllyyyy wish you had code completion. A few years ago, I started working on a project where I needed to use C#. I'd never written a line of C# in my life, so I installed VS and with the aide of Intellisense, I went from having a "Hello World" snippet from Google to using several C# libraries to create a ~1000 line PoC in a day. A few days later, it was production ready. Without Intellisense, this story would be very different.
- DyslexicAtheist 8y agosome languages are more verbose than others. if you're dealing with `ProblemProblemFactory` type of abstraction madness and subscribe to the idea of spelling out every variable (MessageCounter instead of "cnt" etc) then this would seem handy. Maybe it's a question of mindset & philosophy. I personally prefer a minimalist but powerful editor without plugins and just rely on their internal capabilities (which granted are a learning curve). It avoids getting stuck when doing $EDITOR foo on a system you don't own and still feel at home and as fast as on your primary workspace. "How to Do 90% of What Plugins Do (With Just Vim)": https://www.youtube.com/watch?v=XA2WjJbmmoM https://www.youtube.com/watch?v=XA2WjJbmmoM
- n8henrie 8y agoI tried to get this set up for rust / go / python a few weeks ago and found it surprisingly cumbersome, requiring a fair number of other plugins. I ultimately stuck with ale / completor which support async LSP linting and async (non-LSP) completion respectively, and which I found far simpler to set up.
- cletus 8y agoI'm honestly confused at how much effort people spend on .vimrc and .emacs files to get poor versions of narrow slices of functionality that comes out of the box with the most basic of IDEs. Want to dev in Rust? Get IntelliJ Community Edition (free) with the Rust plugin. I'm sure VSCode can do this too (personally I prefer Jetbrains products and have been using them for 15+ years). You can of course use a tty-based text editor over an ssh connection and I use that for Linux servers I connect to of course. I just don't write code that way and don't know why someone would.
- dbalatero 8y agoI prefer the tight terminal integration I get with vim and tmux. I've tried vscode+vim but never felt as fluid.
- adrianhel 8y agoI prefer Vim with iTerm panes. Much easier to use.
- goerz 8y agoIDE’s don’t run in terminals, and the main benefits of terminals are consistency, power, and speed. Plus, at least in scientific computing, you generally have to develop and deploy code on remote workstations or HPC clusters, so an SSH-based workflow is a given.
- atomi 8y agoLoaded with plugins Vim is slower than VSCode on my machine. But I do use Vim, plain, on remote systems.
- asaddhamani 8y agoThat has been my experience. Out of the box Vim is fast sure, but when you add plugins for the thousand and one missing functionalities you get OOTB with VSCode etc., it begins to really slow down.
- enitihas 8y agoOne major advantage of Jetbrains products which I realised after getting a corporate job is I don't need almost any plugins and the experience out of the box is better than anything offered by vim or emacs(granted this is subjective). One major advantage is I don't need to worry about licenses of plugins or having a trust relationship with plugins, which is very essential as I don't want something like the kite episode to happen on my PC. (The kite episode was a company buying some open source plugins for atom and sublime and adding invasive telemetry). If you use jetbrains products, you need to trust only one entity. When using random plugins you are always in the danger of some malicious plugin sending your IP to some random server (rare, but worth keeping in mind.
- ilovecaching 8y agoLet me give you a counterpoint. I have worked at two companies in FAANG now, and I've also worked on the Linux kernel on ethernet drivers. None of those situations allowed the use of Jetbrains. In fact, I've never worked for a place or on a product that didn't allow for vim. Sometimes you will also be required to work from a remote server. I'm not talking about to fiddle bits, I'm talking about real development. There is also a lot of downsides to not working from the terminal. Vim users are consistently better interviewers because they spend more time interacting at the system level. There are a lot of disadvantages to working with an IDE that turns valuable knowledge into a series of black box buttons.
- enitihas 8y agoI don't think there is any issue with Vim itself, and can't see why any place would disallow it. I still use vim on remote servers, and am quite happy with it. Being proficient with vim helps you do things faster for sure. The issue I was raising was to get functionality even comparable to jetbrains products, you need to install a good amount of vim plugins, and then you either audit them constantly, or place a lot of trust in the maintainers. You don't need any of that with jetbrains. Please find an example here: https://news.ycombinator.com/item?id=14857944 https://news.ycombinator.com/item?id=14857944
- mlevental 8y ago
- aptxkid 8y agoTo me, using vim is more about forcing me to understand how things work, or rely less on some IDE magic. IDEs are powerful. It’s too powerful that I don’t know how certain functionalities work. Maybe it’s just me lol.
- aphextron 8y agoSure. But once you know how everything works, you switch back to an IDE. Use the tools that make your life easier, and lose the elitism. There’s nothing more frustrating to me than watching junior engineers struggle to dig through a problem using Vim or Sublime because “That’s What Real Programmers Use”, thinking it’s somehow a crutch to have things like autocomplete or code click through. These tools were built by people far more talented and knowledgeable than you or I because professionals need productivity, not some ephemeral feeling of superiority or nerd cred.
- ilovecaching 8y agoSo before your run off and install v8 just to get autocomplete in Vim, let me make a few suggestions based on my experience: 1. Check out the built in completion first. Vim actually has very powerful autocomplete that can look in the current file, complete file paths, tags, and more. It can look at includes, requires, etc. depending on your language's built in support. For C like languages this is usually excellent. With ctags and this built in completion, you can get 90% of what an LSP will give you. 2. Chances are you've already installed ALE, it's a pretty standard plugin. ALE has built in LSP support, and it's entirely written in vimscript. All you have to do is create an ftplugin for your LSP language and add the LSP into the configured linters list. This is in the primary docs.
- mises 8y agoSeeing as this is a server, is there any way to run it over the network? This seems like the sort of thing a shared codebase could benefit from, with everyone sharing the same, custom-tweaked auto-completion.
- ilovecaching 8y agoThat's why you shouldn't use this product. What you are describing is LSP. This is essentially a very fat thin client. You should try the standard Vim completion framework :help ins-completion or use ALE, which is entirely in vimscript and can run linters, fixers, and LSPs.
- cormacrelf 8y agoNope. It's just another client that speaks LSP. A good one, that does other VSCode-ish stuff, but still, just a client.
- chmln 8y agoAs a heavy user of this plugin on a daily basis, it has made me so much more productive. Recently it also got support for floating windows added in neovim, inching even closer to the quality of completions in VSCode.
- dmitryminkovsky 8y agoLanguage servers are very exciting for me. This past summer I finally installed ALE [0] and it drastically improved my experience and code quality in JS. The live in-editor linting with eslint and formatting with prettier is awesome (and these aren’t even language servers, ALE just uses them as “fixers” and “linters”). So many people denigrade these things as “crutches” for bad programming languages or underdeveloped skills, but I don’t know how you can beat getting live feedback as you type. We are mere mortals! If you don’t have something like ALE installed and you use Vim, you won’t regret the time spent getting it up and running. [0] https://github.com/w0rp/ale https://github.com/w0rp/ale
- PuercoPop 8y agoI agree that is nice idea but sadly only the JS server improves my experience compared to the alternatives, which is more an indictment on the JS toolchain than anything else. And even then its jump to definition leaves a lot to be desired. For example Robe jumps to a method inside Rails that was defined at run-time w/o any issue. Solargraph, even with experimental features enabled doesn't. I look forward to a future where language server implementations improve.
- dmitryminkovsky 8y agoWhich JS server do you use? I tried Webstorm a while back, for example, and found it overwhelming. It tried to do a lot of things it couldn’t do well, so there were many false flags and failed refactoring, which is really frustrating if you’re coming from Java.
- tbodt 8y agoI wrote a javascript language server based on ESLint and Tern: https://github.com/tbodt/js-langserver https://github.com/tbodt/js-langserver
- phasnox 8y agoTake your upvote fellow vimmer
- userbinator 8y ago
- corndoge 8y agoNo C support :( I tried YouCompleteMe but on a 500k line codebase, as well as it works, it's just too slow to stay below the constant annoyance threshold. Would like to play around with adding C support and see how this performs
- IlGrigiore 8y agoThis is not true. It has C/C++/Object C support by using the language server for the language. https://github.com/neoclide/coc.nvim/wiki/Language-servers#ccobjective-c https://github.com/neoclide/coc.nvim/wiki/Language-servers#c... I personally installed ccls and it works as expected.
- deleted 8y ago[deleted]
- Seirdy 8y agoCoc.nvim works flawlessly with [ccls](https://github.com/MaskRay/ccls https://github.com/MaskRay/ccls) for me.
- Foober223 8y agoMaster grep. Searching is not perfect, but it's a trick that gets your petty close to any IDE feature. Find refs, go-to def. Even completion becomes possible via searches. Search to open the class/struct... boom now you can use dumb textual completions on the members. Master your debugger. GDB? learn to use it. You are set for life and can work on any language, anywhere, any time. Everyone wants a ready-made IDE, and it's great when it works out that way for your current dev environment. But it won't work for all languages, or for all project set ups.
- travv0 8y ago> But it won't work for all languages, or for all project set ups. Unlike GDB, right?
- ssddffgghh 8y agotest
- mafro 8y agoCan anyone give a quick comparison to ALE? I'd only ever used YouCompleteMe and found it a bit slow. ALE and COC seem to be pretty much the same - one in vimscript and one node?
- chemzqm 8y agoThe big advantage of ALE is it has much more linters. The big advantage of coc.nvim is it can load extensions forked from VSCode, which have more features most of the time. You can use both of them as the same time, and coc support send diagnostics to ALE.
- wodenokoto 8y agoI have only dabbled with intelligense and language servers, but my out-of-the-box experience has been disappointing when working with pandas and I’m wondering if anyone on HN can talk about whose fault it is and what can be done to improve it. Modern pandas is supposed to be written along the lines of import pandas as pd df = pd.read_csv().transform().agg().pipe() #etc, etc But I am very disappointing in the suggestions I get after the dots in the chain, as well as the parameters inside the functions, when trying out jedi and other language servers in different editors (even ipython is quite disappointing to me)