vim - Vim oneark Colorscheme 未加载,但存在
问题描述
我目前使用 Iterm2 和 Vim 7.4 以及 Minimalist Vim Plugin Manager。通过 Vim 打开文件时,出现错误:
Error detected while processing MYDIRECTORY/.vimrc:
line 19:
E185: Cannot find color scheme 'onedark'
Press ENTER or type command to continue
oneark主题不会加载,但如果在 Vim 中键入:colorscheme onedark
,它会完美加载。
我的 .vimrc 如下:
set t_Co=256
set autoindent
set mouse=a
set number
set shiftwidth=0
set tabstop=4
"let g:airline_theme='onedark'
"Use 24-bit (true-color) mode in Vim/Neovim when outside tmux."
if (has("nvim"))
let $NVIM_TUI_ENABLE_TRUE_COLOR=1
endif
if (has("termguicolors"))
set termguicolors
endif
set background=dark
colorscheme onedark
syntax on
call plug#begin('~/.vim/plugged')
"Make sure you use single quotes
"ATOM Text Editor Default Syntax Theme"
Plug 'https://github.com/joshdick/onedark.vim.git'
"Shorthand notation; fetches https://github.com/junegunn/vim-easy-align
Plug 'junegunn/vim-easy-align'
"Any valid git URL is allowed
Plug 'https://github.com/junegunn/vim-github-dashboard.git'
"Multiple Plug commands can be written in a single line using |
"separators
Plug 'SirVer/ultisnips' | Plug 'honza/vim-snippets'
"On-demand loading
Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
Plug 'tpope/vim-fireplace', { 'for': 'clojure' }
"Using a non-master branch
Plug 'rdnetto/YCM-Generator', { 'branch': 'stable' }
"Using a tagged release; wildcard allowed (requires git 1.9.2 or
"above)
Plug 'fatih/vim-go', { 'tag': '*' }
"Plugin options
Plug 'nsf/gocode', { 'tag': 'v.20150303', 'rtp': 'vim' }
"Plugin outside /.vim/plugged with post-update hook
Plug 'junegunn/fzf', { 'dir': '/.fzf', 'do': './install --all' }
Plug 'https://github.com/exvim/ex-autocomplpop'
"Initialize plugin system
call plug#end()
我该怎么办?
解决方案
vim-plug 的工作方式是这样的:
call plug#begin('~/.vim/plugged')
创建一堆函数/命令并设置一堆选项,
Plug 'https://github.com/joshdick/onedark.vim.git'
将该资源添加到内部列表中,
call plug#end()
~/.vim/plugged
如果它们不存在,则实际安装所有插件,并将您:help 'runtimepath'
设置为正确的值,告诉 Vim 在哪里寻找插件。
所以,基本上,你不能指望 vim-plug 安装的插件在 vim-plug 发挥作用之前可用。
移到colorscheme onedark
下面 call plug#end()
应该可以解决您的问题。
推荐阅读
- javascript - 获取 promise 的最终返回值
- html - 如何在每个弹性框的底部添加文本
- react-native - 更改手机方向时闪烁(纵向到横向)-MaterialTopTab
- python - 用音乐会 python 创建一个类
- r - 如何在R中的气泡图(元包)中为列类别分配颜色
- c++ - 我们可以在 CPP 中实现金属框架吗
- python - 如何修复窗口 8 中 Visual Studio 代码中的导入错误?
- excel - Chrome xls 文件类型为空字符串
- privacy - iOS 14 PHAsset fetchAssetsWithMediaType 选择更多
- mongodb - Mongo:计算所有组的总文档数