V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
BBCCBB
V2EX  ›  Vim

vim+plug.vim, 为什么不加载~/.vim/autoload/文件夹下的 plug.vim 文件呢

  •  
  •   BBCCBB · 2017-09-30 23:28:48 +08:00 · 5095 次点击
    这是一个创建于 2370 天前的主题,其中的信息可能已经有所发展或是发生改变。

    有大佬遇到过这样的问题吗,之前一直在 Windows 上使用这样的配置,没有出现过任何问题, 不过 Windows 上是放在$VIM/vimfiles/autoload/下的,我看了 plug.vim 的官网,unix 上面也是放在~/.vim/autoload/文件夹下 vim 就会自动加载。

    启动 vi m 的时候, 提示 Plug not a command, 这就是没加载到 plug.vim 文件?

    15 条回复    2017-10-02 21:49:35 +08:00
    TimePPT
        1
    TimePPT  
       2017-09-30 23:44:26 +08:00 via iPhone
    " Specify a directory for plugins
    " - For Neovim: ~/.local/share/nvim/plugged
    " - Avoid using standard Vim directory names like 'plugin'
    call plug#begin('~/.vim/plugged')
    TimePPT
        2
    TimePPT  
       2017-09-30 23:45:16 +08:00 via iPhone
    Plug 'xxxxxxxx'

    " Initialize plugin system
    call plug#end()
    TimePPT
        3
    TimePPT  
       2017-09-30 23:47:27 +08:00 via iPhone
    Usage

    Add a vim-plug section to your ~/.vimrc (or ~/.config/nvim/init.vim for Neovim):

    Begin the section with call plug#begin( )
    List the plugins with Plug commands
    call plug#end() to update &runtimepath and initialize plugin system
    Automatically executes filetype plugin indent on and syntax enable. You can revert the settings after the call. e.g. filetype indent off, syntax off, etc.


    https://github.com/junegunn/vim-plug/blob/master/README.md#usage
    582033
        4
    582033  
       2017-10-01 08:01:51 +08:00
    runtime 装了么
    582033
        5
    582033  
       2017-10-01 08:03:17 +08:00
    如果是在非标准 linux 环境下, 比如 openwrt entware 之类的,确保你装的是 vim-full, 而不是 vim
    quinoa42
        6
    quinoa42  
       2017-10-01 10:18:20 +08:00
    看看`set runtimepath?`的输出
    BBCCBB
        7
    BBCCBB  
    OP
       2017-10-02 14:07:36 +08:00
    @582033 我是在 macOS 下面, 用 brew 编译的 vi m
    BBCCBB
        8
    BBCCBB  
    OP
       2017-10-02 14:15:07 +08:00
    @TimePPT 嗯,我的配置文件里写了 call plug#begin(xxx)的
    BBCCBB
        9
    BBCCBB  
    OP
       2017-10-02 14:16:55 +08:00
    @TimePPT 配置文件都是写了的, 我不是小白啊。。。。。只是 macOS 上出现这个问题,太蛋疼了
    BBCCBB
        10
    BBCCBB  
    OP
       2017-10-02 14:21:14 +08:00
    @quinoa42 你好,我用 e cho &runtimepath 查看,我的~/.vim 目录是包含在内的。
    BBCCBB
        11
    BBCCBB  
    OP
       2017-10-02 14:23:30 +08:00
    @582033 macOS 下面也需要装 vim-runtime 吗?
    TimePPT
        12
    TimePPT  
       2017-10-02 14:29:44 +08:00 via iPhone
    @BBCCBB 完全没遇到过……
    BBCCBB
        13
    BBCCBB  
    OP
       2017-10-02 14:34:19 +08:00
    @TimePPT 好吧,谢谢了,这就尴尬了
    582033
        14
    582033  
       2017-10-02 19:04:24 +08:00 via Android
    那你试试我这个看看能加载不,我的也是在 mac 下面,记得改下 install.bash; 不要创建 bashrc 的软连接

    https://github.com/582033/vim.git

    如果不能那看来是环境问题,再逐步排除
    BBCCBB
        15
    BBCCBB  
    OP
       2017-10-02 21:49:35 +08:00
    @582033 https://www.v2ex.com/t/394956#reply2

    谢谢了,我找到问题了,是我犯了个错误。。。。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3102 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 12:55 · PVG 20:55 · LAX 05:55 · JFK 08:55
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.