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

2017-09-30 23:28:48 +08:00
 BBCCBB

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

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

5124 次点击
所在节点    Vim
15 条回复
TimePPT
2017-09-30 23:44:26 +08:00
" 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
2017-09-30 23:45:16 +08:00
Plug 'xxxxxxxx'

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

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

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

谢谢了,我找到问题了,是我犯了个错误。。。。

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/394963

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX