vim-colorscheme没有正确设置背景颜色

时间:2019-02-09 23:59:11

标签: vim background color-scheme

我正在尝试为vim设置nightowl主题,但是它似乎可以部分渲染。语法颜色正确,但是背景显示为黑色。

我的vimrc看起来像这样:

" automatic installation of vim-plug, if it's not available
if empty(glob('~/.vim/autoload/plug.vim'))
  silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
        \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
  autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif

" plugins
call plug#begin('~/.vim/plugged')
Plug 'haishanh/night-owl.vim'
call plug#end()

if (has("termguicolors"))
  set termguicolors
endif

syntax enable
colorscheme night-owl

和:scriptnames

  1: /usr/share/vim/vimrc
  2: ~/.vimrc
  3: ~/dotfiles/vim/plugins.vim
  4: ~/.vim/autoload/plug.vim
  5: /usr/share/vim/vim80/filetype.vim
  6: /usr/share/vim/vim80/ftplugin.vim
  7: /usr/share/vim/vim80/indent.vim
  8: /usr/share/vim/vim80/syntax/syntax.vim
  9: /usr/share/vim/vim80/syntax/synload.vim
 10: /usr/share/vim/vim80/syntax/syncolor.vim
 11: ~/dotfiles/vim/colors.vim
 12: /usr/share/vim/vim80/syntax/nosyntax.vim
 13: ~/.vim/plugged/night-owl.vim/colors/night-owl.vim
 14: /usr/share/vim/vim80/plugin/getscriptPlugin.vim
 15: /usr/share/vim/vim80/plugin/gzip.vim
 16: /usr/share/vim/vim80/plugin/logiPat.vim
 17: /usr/share/vim/vim80/plugin/manpager.vim
 18: /usr/share/vim/vim80/plugin/matchparen.vim
 19: /usr/share/vim/vim80/plugin/netrwPlugin.vim
 20: /usr/share/vim/vim80/plugin/rrhelper.vim
 21: /usr/share/vim/vim80/plugin/spellfile.vim
 22: /usr/share/vim/vim80/plugin/tarPlugin.vim
 23: /usr/share/vim/vim80/plugin/tohtml.vim
 24: /usr/share/vim/vim80/plugin/vimballPlugin.vim
 25: /usr/share/vim/vim80/plugin/zipPlugin.vim
 26: /usr/share/vim/vim80/ftplugin/vim.vim
 27: /usr/share/vim/vim80/indent/vim.vim
 28: /usr/share/vim/vim80/syntax/vim.vim
 29: /usr/share/vim/vim80/syntax/ruby.vim
 30: /usr/share/vim/vim80/syntax/python.vim

它应该是什么样的: night-owl-theme-vim

现在看起来像什么: my-messed-up-night-owl-them

1 个答案:

答案 0 :(得分:0)

Nightowl为背景使用以下定义:

hi Normal guifg=#d6deeb ctermfg=253 guibg=#011627 ctermbg=233 gui=NONE cterm=NONE

对我来说(在gnome-terminal中),该终端的背景值(233)也呈现出几乎黑色的黑色。您可能希望通过复制235命令并将其放在:normal之后来将值调整为较浅的阴影(例如:colorscheme)。

由于这仍然是索引的256色调色板,因此某些终端可能还允许将映射更改为实际的RGB颜色。我想这也可以解释您在屏幕截图中看到的差异。