neoclide / coc.nvim

Nodejs extension host for vim & neovim, load extensions like VSCode and host language servers.
Other
24.31k stars 955 forks source link

Document conditional extension install #827

Closed fatso83 closed 5 years ago

fatso83 commented 5 years ago

Describe the solution you'd like It currently says we should install extensions like this: :CocInstall coc-tsserver. I can't put this in a .vimrc file, as each install slows down the startup. I'd like the docs to provide an example of conditionally loading extensions (or better, make the check to see if an extension is installed take less than the 1-2 secs it currently does).

Describe alternatives you've considered

if !coc-installs('coc-tsserver'); CocInstall coc-tsserver; fi

(or something - don't know vimscript)

Avi-D-coder commented 5 years ago

CocInstall is imperative not declarative. You use it once and coc auto updates for you. The declarative equivalent is: https://github.com/neoclide/coc.nvim/blob/4fee42c30c03d51b8cb213b9651ea996b4d842a9/doc/coc.txt#L756

fatso83 commented 5 years ago

Well, this issue still holds, I guess. Add this to the docs as a suggestion on how to declaratively install extensions. This is typical if you share a setup between different computers through dotfiles :

let g:coc_global_extensions = ['coc-tsserver','coc-json']

I can supply a PR?

Avi-D-coder commented 5 years ago

It's in the docs see above doc/coc.txt.

Run help coc

fatso83 commented 5 years ago

There's a difference between "it's available" and "this is how to use it". I'd bet that half the people with their own dotfiles repo don't really know how Vim configures its shit, but know that "if I put this line in here it works". But well, this issue at least serves as documentation for that, so Mission Accomplished, I guess :man_shrugging:

SkyWriter commented 5 years ago

Just to serve the documentation purpose and to add extra Google keywords: this is how I handled Coc plugins installation in my NixOS / Nix setup which favors declarative functional approach instead of imperative.

chemzqm commented 5 years ago

Another way is use some shell script which mentioned in wiki. It would be easier if we can provide GUI like other editor, but we can't.