当Vim / Neovim突出显示与文本相同的颜色时,无法读取

时间:2017-05-05 23:12:02

标签: vim syntax-highlighting highlighting vim-syntax-highlighting neovim

我一直在尝试将我的vim / neovim游戏提升到一个新的水平,我尝试做的其中一件事就是解决我曾经遇到的突出问题。它的要点是,有时,语法,视觉选择和搜索突出显示使用与原始文本相同/相似的颜色突出显示,使得很难看到突出显示的内容。有谁知道我怎么能解决这个问题?基于第一个屏幕截图,它看起来完全有能力这样做,我似乎无法找到配置选项以使其保持一致。

以下是一些例子(当我在这些中使用neovim时,行为与w / vim相同):

note how the some of the text is almost impossible to read while highlighted?  (it was whitish before highlighting)  the places highlighted in red/blue are much more how i would have expected highlighting to work all the time (the highlight color more or less matches the original text color, but when highlighted, the text color was changed to make the selection readable).请注意一些文字在突出显示时几乎无法阅读? (在突出显示之前它是发白的)以红色/蓝色突出显示的地方更多是我希望突出显示一直工作的方式(高亮颜色或多或少与原始文本颜色匹配,但突出显示时,文本颜色已更改使选择可读。

all occurrences of "if" are highlighted.  again, note how the text and highlighting are pretty much indistinguishable.所有出现的" if"突出显示。再次注意文本和突出显示几乎无法区分。

note how the syntax highlighting (of the [ ] pair in this case) mostly hides what the 2 surrounding characters are.  this also happens with (, ), {, and }.注意语法突出显示(在这种情况下[]对的语法)主要隐藏了2个周围的字符。这也发生在(,),{和}。

.vimrc(init.vim基本相同):

syntax enable
:color peachpuff
set nocp
set wildmenu
set relativenumber
set number
set ignorecase
set smartcase
set incsearch
set nowrap
set tabstop=4
set softtabstop=4
set expandtab
set shiftwidth=4
set showcmd
set clipboard=unnamed
set laststatus=2
set clipboard+=unnamedplus
set directory=~/.vim/tmp

"sudo after opening:
cmap w!! w !sudo tee >/dev/null %

"formatting brackets and such:
inoremap {<Tab> {}<Esc>i
inoremap {<CR> {<CR>}<Esc>ko<Tab>
inoremap (<Tab> ()<Esc>i
inoremap (<CR> (<CR>)<Esc>ko<Tab>
inoremap [<Tab> []<Esc>i
inoremap [<CR> [<CR>]<Esc>ko<Tab>

1 个答案:

答案 0 :(得分:1)

尝试不同的颜色方案。这个插件有负载: https://github.com/flazz/vim-colorschemes

我建议gruvboxtwilightapprentice,但有很多很棒的,找一个适合你的。

您可以安装此插件,以便能够快速切换到下一个colorscheme: https://github.com/xolox/vim-colorscheme-switcher

编辑:这是您在vim中默认安装的colorschemes列表: https://github.com/vim/vim/tree/master/runtime/colors

如果您想在不安装任何插件或其他任何内容的情况下尝试一些,请执行以下操作: :colorscheme evening并了解它们的外观。如果您输入:colorscheme <CTRL-D>,则会显示哪些颜色方案可用。