vim-plug icon indicating copy to clipboard operation
vim-plug copied to clipboard

Update Neovim remote plugin manifest after installing/updating/deleting plugins

Open phaalonso opened this issue 4 years ago • 6 comments

Hi, I tried to use this extension and because it don't work i removed it from my init.vim file, reloaded it and run PlugClean. Now all times that i open neovim I am getting this error

line    2:
Error invoking '/home/pedro/.local/share/nvim/plugged/discord.nvim/rplugin/python3/discord:autocmd:BufEnter:*' on channel 4:
no request handler registered for "/home/pedro/.local/share/nvim/plugged/discord.nvim/rplugin/python3/discord:autocmd:BufEnter:*"
Error invoking '/home/pedro/.local/share/nvim/plugged/discord.nvim/rplugin/python3/discord:autocmd:VimEnter:*' on channel 4:
no request handler registered for "/home/pedro/.local/share/nvim/plugged/discord.nvim/rplugin/python3/discord:autocmd:VimEnter:*"
Press ENTER or type command to continue

My init.vim file:

call plug#begin(stdpath('data') . '/plugged')

Plug 'leafgarland/typescript-vim'
Plug 'ianks/vim-tsx'
"Nerd tree
Plug 'scrooloose/nerdtree'
Plug 'Xuyuanp/nerdtree-git-plugin'
"Add icons to nerdtree
Plug 'ryanoasis/vim-devicons'
Plug 'christoomey/vim-tmux-navigator'

Plug 'HerringtonDarkholme/yats.vim' " TS Syntax

Plug 'neoclide/coc.nvim', {'do': 'yarn install --frozen-lockfile'}

"Temas
Plug 'gruvbox-community/gruvbox'
Plug 'dikiaap/minimalist'


call plug#end()

" coc config
let g:coc_global_extensions = [
\   'coc-snippets',
\   'coc-pairs',
\   'coc-tsserver',
\   'coc-tslint-plugin',
\   'coc-sql',
\   'coc-emmet',
\   'coc-python',
\   'coc-json',
\   'coc-css',
\   'coc-cssmodules',
\   'coc-markdownlint',
\   ]

" Remap keys for gotos
nmap <silent> gd <Plug>(coc-definition)
nmap <silent> gy <Plug>(coc-type-definition)
nmap <silent> gi <Plug>(coc-implementation)
nmap <silent> gr <Plug>(coc-references)

" Remap for rename current word
nmap <F2> <Plug>(coc-rename)

"Use <c-space> to trigger completion.
inoremap <silent><expr> <c-space> coc#refresh()

nmap <C-n> :NERDTreeToggle<CR>
let g:NERDTreeGitStatusWithFlags = 1
let g:NERDTreeIgnore = ['^node_modules$']

"yats
set re=0

set number
set softtabstop=4
set shiftwidth=4
set t_Co=256
syntax on
"colorscheme minimalist
colorscheme gruvbox


NVIM v0.5.0-nightly-6-gef0398f
Build type: Release
LuaJIT 2.1.0-beta3
Compilation: /usr/bin/cc -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -O2 -DNDEBUG -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=always -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -DMIN_LOG_LEVEL=3 -I/root/parts/nvim/build/build/config -I/root/parts/nvim/build/src -I/root/parts/nvim/build/.deps/usr/include -I/usr/include -I/root/parts/nvim/build/build/src/nvim/auto -I/root/parts/nvim/build/build/include
Compiled by root@snapcraft-nvim

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/share/nvim"
  • Type:
    • [x] Bug
    • [ ] Enhancement
    • [ ] Feature Request
    • [ ] Question
  • OS:
    • [ ] All/Other
    • [x] Linux
    • [ ] OS X
    • [ ] Windows
  • Vim:
    • [ ] Terminal Vim
    • [ ] GVim
    • [x] Neovim

phaalonso avatar Jun 21 '20 21:06 phaalonso

I found a solution, when I removed the extension there is a rplug.vim file with a call to the file that is delleted. When I commented the call the problem stopped. The file was in /home/pedro/.local/share/nvim/

phaalonso avatar Jun 22 '20 14:06 phaalonso

:h :UpdateRemotePlugins Can you investigate if it's safe to run this to update rplugin.vim everytime PlugClean runs? I don't use remote plugins myself except for coc.nvim but coc.nvim does not depend on rplugin.vim.

janlazo avatar Jun 23 '20 00:06 janlazo

Yep, running :UpdateRemotePlugins deleted the lines that the plugin let behind in the rplugin.vim file.

phaalonso avatar Jun 23 '20 19:06 phaalonso

Can you investigate if it's safe to run UpdateRemotePlugin after running PlugInstall or PlugUpdate? If it is safe, then vim-plug can run it by default without having user to run it explicitly.

janlazo avatar Jun 23 '20 22:06 janlazo

Sorry for the wait, I tried and it worked. How i can make it to run in default?

phaalonso avatar Jun 26 '20 19:06 phaalonso

Create a PR to update s:update_finish() or other internal Vimscript code to run :UpdateRemotePlugin after all plugins are installed/updated. Environment variable NVIM_RPLUGIN_MANIFEST must be set on neovim build so that tests do not break user config.

There is User autocmd https://github.com/junegunn/vim-plug#on-demand-loading-of-plugins but it is intended for one plugin only unless you run vim-plug in synchronous mode.

janlazo avatar Jun 26 '20 23:06 janlazo