vim - macVim Dracula 配色方案与 Sublime Dracula 主题不相似
问题描述
在 macOS Catalina (10.15.4) 上安装了以下编辑器:
麦克维姆 (8.2.539)
崇高 3 (3.2.2 - 构建 3211)
在两者中都安装了 Dracula 颜色主题(对最初创建此颜色方案/主题的人大喊大叫 - 它摇滚!)。
问题是它们看起来不太相似(macVim 上的那个 Java 包导入和注释语法颜色很糟糕)。
看看包导入和注释的颜色有多糟糕?
Sublime 3 的 Dracula 主题摇滚:
有人可以帮助我编辑里面的特定颜色,.vimrc/autoload/dracula.vim
以便它可以匹配 Sublime 3 的 Dracula 主题的颜色吗?
如果没有,我自己在哪里可以编辑(什么文件和条目)以手动尝试不同的颜色,用于 Java 相关的包导入和注释?
有没有办法让 macVim 的 Dracula 主题与 Sublime 3 的相同(在颜色方面)?
此处列出了 Dracula Sublime 的颜色代码:
https://github.com/dracula/sublime/blob/b7e8961afa4c11d620ad26abe28d76929c7ff90b/Dracula.tmTheme
尝试编辑.vimrc/autoload/dracula.vim
,没有任何改变。:(
更多详细信息:尝试通过 Vim-Plug 加载/安装 Dracula,但没有任何反应,所以我手动将 Dracula Vim 的 Github 中的文件插入(这是唯一可行的方法):
~.vimrc/autoload/dracula.vim
~.vimrc/colors/dracula.vim
.vimrc:
set nu
set ruler
" set rulerformat=%l\:%c
set autoindent
syntax on
set showmatch " Shows matching brackets
set nocompatible
set t_Co=256
set tabstop=4
set laststatus=2
set encoding=utf-8
set smarttab " Autotabs for certain code
set shiftwidth=4
if has("gui_running")
if has("gui_gtk2")
set guifont=Inconsolata\ 12
elseif has("gui_macvim")
set guifont=JetBrains\ Mono\ Regular:h14
elseif has("gui_win32")
set guifont=Consolas:h11:cANSI
endif
endif
" colorscheme pencil
colorscheme dracula
set background=light
let g:airline_theme = 'pencil'
call plug#begin('~/.vim/plugged')
Plug 'itchyny/lightline.vim'
Plug 'preservim/nerdtree'
Plug 'dracula/vim', { 'as': 'dracula' }
call plug#end()
map <C-t> :NERDTreeToggle<CR>
.gvimrc
set nu
set ruler
set rulerformat=%l\:%c
set autoindent
syntax on
set nocompatible
set t_Co=256
set tabstop=4
set laststatus=2
set encoding=utf-8
if has("gui_running")
if has("gui_gtk2")
set guifont=Inconsolata\ 12
elseif has("gui_macvim")
set guifont=JetBrains\ Mono\ Regular:h14
elseif has("gui_win32")
set guifont=Consolas:h11:cANSI
endif
endif
" colorscheme pencil
colorscheme dracula
set background=light
let g:airline_theme = 'pencil'
call plug#begin('~/.vim/plugged')
Plug 'itchyny/lightline.vim'
Plug 'preservim/nerdtree'
Plug 'dracula/vim', { 'as': 'dracula' }
call plug#end()
map <C-t> :NERDTreeToggle<CR>
~/.vimrc
的顶级文件夹结构:
~/.vim$ ls
autoload colors plugged
里面~/.vim/plugged dir
:
├── dracula
│ ├── INSTALL.md
│ ├── LICENSE
│ ├── README.md
│ ├── after
│ │ ├── plugin
│ │ │ └── dracula.vim
│ │ └── syntax
│ │ ├── css.vim
│ │ ├── gitcommit.vim
│ │ ├── html.vim
│ │ ├── javascript.vim
│ │ ├── json.vim
│ │ ├── markdown.vim
│ │ ├── ocaml.vim
│ │ ├── perl.vim
│ │ ├── php.vim
│ │ ├── plantuml.vim
│ │ ├── python.vim
│ │ ├── ruby.vim
│ │ ├── rust.vim
│ │ ├── sass.vim
│ │ ├── sh.vim
│ │ ├── tex.vim
│ │ ├── typescript.vim
│ │ ├── typescriptreact.vim
│ │ ├── vim.vim
│ │ ├── xml.vim
│ │ └── yaml.vim
│ ├── autoload
│ │ ├── airline
│ │ │ └── themes
│ │ │ └── dracula.vim
│ │ ├── dracula.vim
│ │ └── lightline
│ │ └── colorscheme
│ │ └── dracula.vim
│ ├── colors
│ │ └── dracula.vim
│ ├── doc
│ │ ├── dracula.txt
│ │ └── tags
│ └── screenshot.png
解决方案
通过将颜色方案放置在 .vimrc 和 .gvimrc 中的 call plug# 部分之后使其工作:
set nu
set ruler
" set rulerformat=%l\:%c
set autoindent
syntax on
set showmatch " Shows matching brackets
set nocompatible
set t_Co=256
set tabstop=4
set laststatus=2
set encoding=utf-8
set smarttab " Autotabs for certain code
set shiftwidth=4
if has("gui_running")
if has("gui_gtk2")
set guifont=Inconsolata\ 12
elseif has("gui_macvim")
set guifont=JetBrains\ Mono\ Regular:h14
elseif has("gui_win32")
set guifont=Consolas:h11:cANSI
endif
endif
set background=light
let g:airline_theme = 'pencil'
call plug#begin('~/.vim/plugged')
Plug 'itchyny/lightline.vim'
Plug 'preservim/nerdtree'
Plug 'dracula/vim', { 'as': 'dracula' }
call plug#end()
" colorscheme pencil
colorscheme dracula
map <C-t> :NERDTreeToggle<CR>
不过请注意,如果您使用 vim-plug,您仍然必须手动将特定的 dracula.vim 文件手动放入 autoload 和 colors 目录中。根据 Vim 的 Github 页面的 Dracula,这些说明是不正确的。
推荐阅读
- c# - 如何解决一段音频后的调用导致音频延迟?
- android - 我想下载 jdk windows 32 位
- android - 如何在片段附加到活动之前执行后台任务?
- javascript - 如何使用 JavaScript 创建自定义弹出窗口
- jquery - 如何使用 jQuery 从 HTML 节点中选择文本内容?
- reactjs - 模型打开正在工作,但关闭功能在反应 js 中不起作用
- php - 发送包含来自表单输入和数据库数据的混合数据的电子邮件
- java - .class 文件是字节码吗?或 .class 文件是否包含字节码?
- node.js - 护照的身份验证功能如何知道要验证哪个请求?
- android-studio - 如何将库添加到 android studio 而不是单个项目