Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run :CocInstall <something> non-interactively in command line interface #450

Closed
cih9088 opened this issue Feb 18, 2019 · 9 comments
Closed

Comments

@cih9088
Copy link

cih9088 commented Feb 18, 2019

It would be great if CocInstall command works in CLI with +qall.

In case of vim-plug, nvim +'PlugInstall' +qall in command line would install all of plugins specified in init.vim and quit neovim after done. There is no need to interact with neovim.

nvim +'CocInstall coc-json' +qall should work as above. Install coc-json and quit neovim.
However nvim +'CocInstall coc-json' +qall seems that neovim quit before install is done.

Though nvim +'CocInstall coc-json' works as expected but vim should be closed manually with :q which is not preferable in automated script.

@chemzqm
Copy link
Member

chemzqm commented Feb 18, 2019

But you don't need to run CocInstall in that way, you can run the command and continue your work, the extension would be loaded and activated when necessary after installed.

Checkout https://github.com/neoclide/coc.nvim/wiki/Install-coc.nvim#automation-script for automation setup script.

You can use nvim +CocUpdateSync +qall to update extensions.

@cih9088
Copy link
Author

cih9088 commented Feb 19, 2019

That's fair enough but nvim +'CocInstall coc-json' +qall should work just like nvim +CocUpdateSync +qall, I suppose.
If its not for you, that's ok. https://github.com/neoclide/coc.nvim/wiki/Install-coc.nvim#automation-script is totally fine for me.

@aswin-raghavan
Copy link

This is still an issue. Can we please open it again? There seems to be no solution and simply dismissed the issue

@chemzqm
Copy link
Member

chemzqm commented May 22, 2020

@aswin-raghavan can't reproduce, you have to provide the way to reproduce instead just complain.

nvim +'CocInstall -sync coc-json' +qall

nvim +CocUpdateSync +qall

should works, you could have network issue, so make sure checkout the log.

It's also documented in wiki https://github.com/neoclide/coc.nvim/wiki/Using-coc-extensions, if you can't read, consider not use it at all to avoid waste of your time.

@cih9088
Copy link
Author

cih9088 commented May 22, 2020

I'm glad this feature has been added. Many thanks

@aswin-raghavan
Copy link

aswin-raghavan commented May 22, 2020

It does not work for me. As in, it works without qall and does not work when +qall is added.
What I mean by works: By checking :CocList extensions before and after running the command from command line.

  1. nvim +'CocInstall -sync coc-svg' +qall
  2. nvim +'CocUpdateSync +qall
  3. nvim +'CocList extensions'
    ... does not show coc-svg, shows many other extensions that were installed manually ...

There is a brief flash of an error when I run nvim +'CocInstall -sync coc-svg' +qall which reads

Error on request (installExtensions): Vim(return):Error invoking 'installExtensions' on channel 3 (coc): fn(...).finally is not a function

I am on nvim inside a custom docker so it is a bit hard to give a simple reproduce script

Ubuntu 18.04
:checkhealth is ok
node version is v8.10.0
npm version is 3.5.2
nvim installed from nvim-stable PPA version:

Build type: Release
LuaJIT 2.1.0-beta3
Compilation: /usr/bin/cc -g -O2 -fdebug-prefix-map=/build/neovim-U5Ub0w/neovim-0.4.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=1 -DDISABLE_LOG -Wdate-time -D_FORTIFY_SOURCE=1 -O2 -DNDEBUG -DMIN_LOG_LEVEL=3 -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fdiagnostics-color=always -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -I/build/neovim-U5Ub0w/neovim-0.4.3/build/config -I/build/neovim-U5Ub0w/neovim-0.4.3/src -I/usr/include -I/usr/include/lua5.1 -I/build/neovim-U5Ub0w/neovim-0.4.3/build/src/nvim/auto -I/build/neovim-U5Ub0w/neovim-0.4.3/build/include
Compiled by team+vim@tracker.debian.org

Features: +acl +iconv +tui```

@chemzqm
Copy link
Member

chemzqm commented May 22, 2020

node version is v8.10.0

It's bug that we use Promise.finally which doesn't exists on node v8, will be fixed soon and we will drop support for node v8 in near future.

@aswin-raghavan
Copy link

Does upgrading node solve the problem currently?
Can we open this issue (or) open a new issue for this bug?

@chemzqm
Copy link
Member

chemzqm commented May 22, 2020

Can we open this issue (or) open a new issue for this bug?

It's fixed, if you still have problem, please create a new issue.

jeffmccune added a commit to jeffmccune/dotfiles2021 that referenced this issue Mar 29, 2021
jeffmccune added a commit to jeffmccune/dotfiles2021 that referenced this issue Mar 30, 2021
This patch uses ~/.dotfiles2021/scripts/asdf-node-shim to enable neovim
to execute node and yarn using fully qualified paths, without node and
yarn having to be in the shell $PATH.

Auto install vim-plug and coc plugins

References for headless installations

 * junegunn/vim-plug#1036
 * neoclide/coc.nvim#450

Refactor to everything in ~/.dot or ~/dotfiles

Update zsh to use DOTDIR

Integrate $DOTDIR with zsh and powerline
rjoost pushed a commit to rjoost/coc.nvim that referenced this issue Dec 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants