我在哪里可以找到默认颜色方案的* .vim文件

时间:2014-03-17 23:46:35

标签: vim

在浏览了数十种颜色方案后,我找不到比“默认”vim颜色方案更好的东西。

我想稍微扭曲一下,但找不到方案文件,这样的文件存在吗?或者有没有办法将当前方案保存到文件中并进行编辑?

3 个答案:

答案 0 :(得分:4)

$VIMRUNTIME/colors/default.vim

不会帮助你,因为它没有定义单一颜色。实际的默认颜色是用"特殊"定义的。语法:

$VIMRUNTIME/syntax/syncolor.vim

以下是它的要点:

if &background == "dark"
  SynColor Comment        term=bold cterm=NONE ctermfg=Cyan ctermbg=NONE gui=NONE guifg=#80a0ff guibg=NONE
  SynColor Constant       term=underline cterm=NONE ctermfg=Magenta ctermbg=NONE gui=NONE guifg=#ffa0a0 guibg=NONE
  SynColor Special        term=bold cterm=NONE ctermfg=LightRed ctermbg=NONE gui=NONE guifg=Orange guibg=NONE
  SynColor Identifier     term=underline cterm=bold ctermfg=Cyan ctermbg=NONE gui=NONE guifg=#40ffff guibg=NONE
  SynColor Statement      term=bold cterm=NONE ctermfg=Yellow ctermbg=NONE gui=bold guifg=#ffff60 guibg=NONE
  SynColor PreProc        term=underline cterm=NONE ctermfg=LightBlue ctermbg=NONE gui=NONE guifg=#ff80ff guibg=NONE
  SynColor Type           term=underline cterm=NONE ctermfg=LightGreen ctermbg=NONE gui=bold guifg=#60ff60 guibg=NONE
  SynColor Underlined     term=underline cterm=underline ctermfg=LightBlue gui=underline guifg=#80a0ff
  SynColor Ignore         term=NONE cterm=NONE ctermfg=black ctermbg=NONE gui=NONE guifg=bg guibg=NONE
else
  SynColor Comment        term=bold cterm=NONE ctermfg=DarkBlue ctermbg=NONE gui=NONE guifg=Blue guibg=NONE
  SynColor Constant       term=underline cterm=NONE ctermfg=DarkRed ctermbg=NONE gui=NONE guifg=Magenta guibg=NONE
  SynColor Special        term=bold cterm=NONE ctermfg=DarkMagenta ctermbg=NONE gui=NONE guifg=SlateBlue guibg=NONE
  SynColor Identifier     term=underline cterm=NONE ctermfg=DarkCyan ctermbg=NONE gui=NONE guifg=DarkCyan guibg=NONE
  SynColor Statement      term=bold cterm=NONE ctermfg=Brown ctermbg=NONE gui=bold guifg=Brown guibg=NONE
  SynColor PreProc        term=underline cterm=NONE ctermfg=DarkMagenta ctermbg=NONE gui=NONE guifg=Purple guibg=NONE
  SynColor Type           term=underline cterm=NONE ctermfg=DarkGreen ctermbg=NONE gui=bold guifg=SeaGreen guibg=NONE
  SynColor Underlined     term=underline cterm=underline ctermfg=DarkMagenta gui=underline guifg=SlateBlue
  SynColor Ignore         term=NONE cterm=NONE ctermfg=white ctermbg=NONE gui=NONE guifg=bg guibg=NONE
endif
SynColor Error            term=reverse cterm=NONE ctermfg=White ctermbg=Red gui=NONE guifg=White guibg=Red
SynColor Todo             term=standout cterm=NONE ctermfg=Black ctermbg=Yellow gui=NONE guifg=Blue guibg=Yellow

答案 1 :(得分:1)

这可能取决于系统,但要查看当前colorscheme的名称,请使用

:colorscheme

如果是default,您可以通过locate default.vimfind / -name default.vim找到它。

对我而言

/usr/share/vim/vim73/colors/default.vim

答案 2 :(得分:0)

这是我的default.vim文件中的内容

" Vim color file
" Maintainer:   Bram Moolenaar <Bram@vim.org>
" Last Change:  2001 Jul 23

" This is the default color scheme.  It doesn't define the Normal
" highlighting, it uses whatever the colors used to be.

" Set 'background' back to the default.  The value can't always be estimated
" and is then guessed.
hi clear Normal
set bg&

" Remove all existing highlighting and set the defaults.
hi clear

" Load the syntax highlighting defaults, if it's enabled.
if exists("syntax_on")
  syntax reset
endif

let colors_name = "default"

" vim: sw=2

如您所见,没有定义颜色。但是,您可以查看与default.vim相同的文件夹中的其他颜色方案,以了解如何定义颜色,然后您可以将它们添加到default.vim或创建自己的颜色方案。

另见

:help coloring