lervag / vimtex

VimTeX: A modern Vim and neovim filetype plugin for LaTeX files.
MIT License
5.53k stars 390 forks source link

[Feature Request] Add coc.nvim support #1349

Closed voldikss closed 5 years ago

voldikss commented 5 years ago

coc.nvim is a modern completion framework plugin for Vim/NeoVim. It's very fast and easy to use.

Currently I am using snippets with coc to compelte Tex code. Notice that vimtex have support for Deoplete, ncm2, YCM, it will be fantastic if vimtex also support coc.nvim.

How do you think about this?

P.S. this might be helpful: Create custom source

clason commented 5 years ago

Did you see https://github.com/neoclide/coc-vimtex?

voldikss commented 5 years ago

I'm so sorry 😥 for that

lervag commented 5 years ago

No reason to be sorry! I think coc-vimtex should be documented in vimtex as well, which is currently missing.

clason commented 5 years ago

@voldikss Yes, please! I'd be great if you could try it out and maybe even make a PR for the documentation.

voldikss commented 5 years ago

@clason @lervag I just forked vimtex project, the coc.nvim will be documented soon

voldikss commented 5 years ago

Just made a PR for coc.nvim & coc-vimtex introduction.

lervag commented 5 years ago

Thanks, @voldikss! I think #1351 resolves this issue. What do you think, @clason?

clason commented 5 years ago

Looks good! I'm not sure whether the installation instructions should be more explicit (installing CoC is not as simple as Plug 'neoclide/coc.nvim', since you also need to install the binary, which could be tricky depending on how much of the dependencies you've already installed)?

voldikss commented 5 years ago

Hmmmm It does need some pre-requirements... Sorry I forgot it, and it should be introduced in detail.

But notice that it will be much stuff to about CoC's installation, how about just providing the link of CoC's README? https://github.com/neoclide/coc.nvim/blob/master/Readme.md

clason commented 5 years ago

Yes, that should be sufficient: make clear that it's not just Plug and play, and give a link to the installation instructions (although https://github.com/neoclide/coc.nvim/wiki/Install-coc.nvim is probably a better target than a deep link to the source code).

voldikss commented 5 years ago

Yes, I agree.

Since that's is a pretty little modification, a PR might be troublesome. So could please you modify and commit it?

It's midnight here, I am in the bed now :smile:

lervag commented 5 years ago

I think my update should resolve this.

lervag commented 5 years ago

By the way: Do you have any experience with ncm2 and/or deoplete, and if so, how would you compare coc.nvim to these? I've used neocomplete, then ncm2, then deoplete, and for now I'm relatively satisfied with deoplete.

voldikss commented 5 years ago

Thank you @lervag

I've being using Deoplete before CoC, it is quite convenient and out of box. However it seems to be pretty show, so I switched to CoC.

Besides, I haven't used ncm2 and neocomplete, I've used YCM 3 years ago when I came into Vim. But YCM is bulky.

lervag commented 5 years ago

Ok, thanks. I've not really had an issue with deoplete being slow. I looked into CoC yesterday, but it seems very inconvenient to configure.

voldikss commented 5 years ago

It's not that inconvenient actually. I won't persuade you to use coc, but if you did suffered a lot from Deoplete's slow performance you should have a try with coc.

For people who haven't used coc before, it might be convoluted when they first looked at coc. But it has a quite detailed doc as well as it's wiki. Furthermore, only the basic configuration can get coc to work.

Since you are a Vim developer, it will be fine for you to configure it.

Both deoplete and coc are excellent, just pick which are suitable for you.

voldikss commented 5 years ago

Ho! I just hear from vim-cn telegram group that coc is on the github trending today! See https://github.com/trending :astonished:

voldikss commented 5 years ago

Excuse me for a confusion:

I read vim-airline's document today, why not add that documentation in the doc/vimtex.txt? see: https://github.com/vim-airline/vim-airline/blob/master/doc/airline.txt#L1061

lervag commented 5 years ago

I read vim-airline's document today, why not add that documentation in the doc/vimtex.txt? see: https://github.com/vim-airline/vim-airline/blob/master/doc/airline.txt#L1061

I'm not quite sure what you mean. Could you elaborate?

Ho! I just hear from vim-cn telegram group that coc is on the github trending today!

Cool!

It's not that inconvenient actually. I won't persuade you to use coc, but if you did suffered a lot from Deoplete's slow performance you should have a try with coc.

As mentioned, I did not suffer slow performance. But I am always looking for ways to improve my Vim usage, and if there are clear benefits then I am willing to change my ways. :)

Since you are a Vim developer, it will be fine for you to configure it.

Yes, probably. What confuses me the most is that coc.nvim seems to be more than just completion. It seems that I may replace both deoplete and vim-lsp. Thus the change becomes more complicated, since there are quite a few plugins that might become redundant or unnecessary. In any case, thanks for your comments, I may look into testing coc.nvim when I get more time.

lervag commented 5 years ago

Reg. vim-airline: Do you have a suggestion to where in the vimtex docs it should be mentioned? I don't think it makes sense to write much, but I agree it might be good to mention that the plugins work well together.

voldikss commented 5 years ago

I have no idea about this:(. Maybe that makes no sense, it's just a little integration which is hard to insert into the vimtex.txt

lervag commented 5 years ago

Ok, thanks. I think I'll leave it as it is, because the information is already clear at vim-airline's side, where it matters. If you (or anyone else) have a clear idea where and how it could be documented in vimtex, then I'm all ears.

patnr commented 3 years ago

It might be worth documenting as well some map conflicts with coc's, whose README suggests a ton of mappings. For example, nmap K is used by both vimtex and coc to show documentation.

lervag commented 3 years ago

Yes, feel free to suggest something specific :)

patnr commented 3 years ago

You mean a PR? I can do that. But there may be several other conflicts that I'm not aware of yet.

lervag commented 3 years ago

Either a PR or just a concrete suggestion is also fine. I'm not sure if it is worth commenting on all conflicts, though; these may change in time and keeping things updated will be too much work.