AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题 / 1116114
Accepted
Maks.Burkov
Maks.Burkov
Asked: 2019-02-07 06:29:48 +0800 CST2019-02-07 06:29:48 +0800 CST 2019-02-07 06:29:48 +0800 CST

Vundle(Vim 插件)配置问题

  • 772

我在我的文件中编写了以下配置/etc/vim/vimrc来运行 Vundle 插件。

为什么我得到这个错误?

我添加的 Vim 配置块:

set nocompatible              " be iMproved, required
filetype off                  " required

" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')

" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'

" All of your Plugins must be added before the following line
call vundle#end()            " required
filetype plugin indent on    " required
" To ignore plugin indent changes, instead use:
"filetype plugin on
"
" Brief help
" :PluginList       - lists configured plugins
" :PluginInstall    - installs plugins; append `!` to update or just :PluginUpdate
" :PluginSearch foo - searches for foo; append `!` to refresh local cache
" :PluginClean      - confirms removal of unused plugins; append `!` to auto-approve removal
"
" see :h vundle for more details or wiki for FAQ
" Put your non-Plugin stuff after this line

我在运行时遇到了这些错误.vimrc:

root@someone-System-Product-Name:/etc/vim# vim vimrc
Error detected while processing /usr/share/vim/vimrc:
line    6:
E117: Unknown function: vundle#begin
line   11:
E492: Not an editor command: Plugin 'VundleVim/Vundle.vim'
line   14:
E117: Unknown function: vundle#end
Press ENTER or type command to continue

如果我运行:PluginInstall,我得到了错误'Not an editor command'。

configuration vim command-line root etc
  • 1 1 个回答
  • 851 Views

1 个回答

  • Voted
  1. Best Answer
    Melebius
    2019-02-07T23:36:52+08:002019-02-07T23:36:52+08:00

    您正在将系统范围的配置与用户配置混合。

    Vundle的手册建议将脚本添加到“您的.vimrc”,即~/.vimrc,特别是添加指向~/.vim/bundle/Vundle.vim. 这两个文件都驻留在用户的主目录 ( ~) 中,不会影响其他用户。

    然而,如果你把脚本(包括用户主目录的链接!)放到系统范围的 Vim 配置/etc/vim/vimrc中,你必须

    • 将文件放置Vundle.vim到系统范围内有效的位置(例如/opt,/etc/vim)并提供路径/etc/vim/vimrc
    • 或确保该文件~/.vim/bundle/Vundle.vim对任何用户都存在,包括 root。

    root的主目录 ( ~) 是/root. 因此,如果/root/.vim/bundle/Vundle.vim您的机器上不存在该文件,Vim 在处理您/etc/vim/vimrc作为 root 用户时无法加载它。

    我在运行时遇到了这些错误.vimrc:

    # vim vimrc
    

    这可能与vimrc具体打开文件无关,该问题会影响启动 Vim,因为 Vim 在此期间会读取其配置文件。即使您发出vim没有任何文件的普通命令,它也应该发生。

    顺便说一下,请注意文件名的每个字符。vimrc不等于.vimrc,这些是不同的文件。

    • 2

相关问题

  • 如何从命令行判断机器是否需要重新启动?

  • 文件权限如何工作?文件权限用户和组

  • 保持多个工作站同步

  • 如何在 Vim 中启用全彩支持?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve