处理 vimrc 时检测到错误: - 如何在 vim 中获取 pugins

问题描述 投票:0回答:2

今天我正在制作自定义 vimrc,但它给了我这个错误。它不允许我使用任何插件。有人可以帮助告诉我做错了什么吗?这些行是它显示的错误:

E117: Unknown function: plug#begin
line   10:
E492: Not an editor command: Plug 'rbgrouleff/bclose.vim'
line   11:
E492: Not an editor command: Plug 'dbakker/vim-projectroot'
line   12:
E492: Not an editor command: Plug 'scrooloose/nerdtree'
line   13:
E492: Not an editor command: Plug 'junegunn/fzf'
line   14:
E492: Not an editor command: Plug 'junegunn/fzf.vim'
line   15:
E492: Not an editor command: Plug 'majutsushi/tagbar'
line   18:
E492: Not an editor command: Plug 'vim-airline/vim-airline'
line   19:
E492: Not an editor command: Plug 'vim-airline/vim-airline-themes'
line   20:
E492: Not an editor command: Plug 'bling/vim-bufferline'
line   21:
E492: Not an editor command: Plug 'altercation/vim-colors-solarized'
line   24:
E492: Not an editor command: Plug 'Raimondi/delimitMate'
line   25:
E492: Not an editor command: Plug 'scrooloose/nerdcommenter'
line   26:
E492: Not an editor command: Plug 'tpope/vim-sleuth'
line   27:
E492: Not an editor command: Plug 'Valloric/YouCompleteMe', { 'do': './install.py --clangd-completer --go-completer --rust-completer --ts-completer' }
line   28:
E492: Not an editor command: Plug 'rdnetto/ycm-generator', { 'branch': 'stable' }
line   58:
E117: Unknown function: plug#end
line   97:
E216: No such group or event: TermOpen * set bufhidden=hide
vim vim-plugin
2个回答
5
投票

您需要安装 vim-plug,您可以在此处找到有关如何安装的说明:https://github.com/junegunn/vim-plug#installation


0
投票

对于那些在 Ubunutu 或其他基于 debian 的操作系统上使用 neovim 的人,您需要在plug#begin()行中添加plug.vim文件(插件目录)的路径。

例如,如果您使用 ubuntu 并使用

sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
安装了 vim-plug ,那么你的plug.vim文件可能在
~/.local/share/nvim/site/autoload/plug.vim
下。

因此你的plug#begin()行应该如下所示:

call plug#begin('~/.local/share/nvim/site/autoload')
© www.soinside.com 2019 - 2024. All rights reserved.