Shougo / dein.vim

:zap: Dark powered Vim/Neovim plugin manager
MIT License
3.42k stars 197 forks source link

When use 'lazy' option get waring message 'plugin name is already defined.' #397

Closed hare001 closed 3 years ago

hare001 commented 3 years ago

Problems summary

When I use call dein#add('suan/vim-instant-markdown', {'lazy': 1, 'on_ft': 'markdown'}) or call dein#config('vim-instant-markdown', {'lazy': 1, 'on_ft': 'markdown'}), I got a warning message when I save init.vim file.like this:[dein] Plugin name "vim-instant-markdown" is already defined.

Expected

no warning message when I save init.vim file.

Environment Information (Required!)

Provide a minimal .vimrc with less than 50 lines (Required!)

" Your minimal .vimrc
let s:dein_path = '~/.config/nvim/dein'
let &runtimepath = &runtimepath.','.s:dein_path.'/repos/github.com/Shougo/dein.vim'
call dein#begin(s:dein_path)
call dein#add('suan/vim-instant-markdown', {'lazy': 1, 'on_ft': 'markdown'})
"call dein#add('suan/vim-instant-markdown')
"call dein#config('vim-instant-markdown', {
            "\ 'lazy': 1, 'on_ft': 'markdown',
            "\ })
call dein#end()

if dein#check_install()
    call dein#install()
endif
autocmd! BufNewFile $MYVIMRC source %

The reproduce ways from Vim starting (Required!)

  1. :call dein#install() to install plugins
  2. :w to save the init.vim file
  3. if the second step doesn't show warning message, use :w to save twice

Screen shot (if possible)

image

Upload the log messages by :redir and :message (if errored)

"init.vim" 483L, 11854C 已写入
[dein] Plugin name "vim-instant-markdown" is already defined.
[dein] Plugin name "vim-markdown-toc" is already defined.
Shougo commented 3 years ago

Closing. Because you don't have uploaded reproduce-able vimrc.

Why? It is not included BufWritePost autocmd in the vimrc.

Shougo commented 3 years ago
set runtimepath^=~/work/dein.vim
if dein#load_state('~/work/test')
  call dein#begin('~/work/test')

  " markdown
  call dein#add('suan/vim-instant-markdown')
  "call dein#config('vim-instant-markdown', {
        "\ 'lazy': 1, 'on_ft': 'markdown',
        "\ })
  call dein#add('mzlogin/vim-markdown-toc')
  "call dein#config('vim-markdown-toc', {
        "\ 'lazy': 1, 'on_ft': 'markdown',
        "\ })

  call dein#end()
  call dein#save_state()
endif

autocmd! bufwritepost $MYVIMRC source %

It works for me.

Shougo commented 3 years ago

Reproduced.