这次我们研究了配色方案
找到了 colors 的位置
下载并应用了颜色方案
制作了自己的配色方案
下面我想修改配色方案的颜色🤔
是否能成功???

#找到colors的位置cd usr/share/vim/vim81/colors#列出所有配色方案ls#复制出自己的配色方案sudo cp murphy.vim oeasy.vim#查看配色方案信息sudo vi oeasy.vim

前 5 行是注释
第 7 行取消原来的配色
第 8 行设置背景
第 9-11 行重设语法高亮
第 12 行命名此配色方案,可以修改为 oeasy
第 14 行开始设置各种高亮组的颜色
我们先修改第一个高亮组 Normal
注释Comment
常量Constant等
Normal的意思是一般文字
这类的文字都属于这个高亮组
与此类似的还有
首先把配色方案名称改为 oeasy
找到 Normal 组
把 Normal 组的背景色ctermbg 改为 blue
把 Normal 组的前景色 ctermfg 改为 yellow
:w 保存配色文件
colorscheme oeasy 重新设定配色文件

:hi Normal 可以查看 Normal 组的配色
:hi 可以查看当前色彩方案所有的配色
xxx 就是效果预览

hi 是 highlight 的缩写
:h hi 可以查询帮助

:hi StatusLine
:hi StatusLine cterm=bold
:hi StatusLine cterm=bold,italic
:hi StatusLine cterm=bold,italic
:hi StatusLine cterm=bold,italic,underline
:hi StatusLine

term
意思是terminal
效果之间可以加逗号
对应黑白终端
在此无效
cterm
bold 加粗
underline 下划线
italic 倾斜
NONE 取消任何效果
hi StatusLine
hi StatusLine ctermfg=red ctermbg=blue
hi StatusLine
ctermfg
意思是color terminal fore color
前景色设置
ctermfg=white
ctermbg
意思是color terminal back color
被景色设置
ctermfg=red
gui相关的属性呢
与gui相关
当前终端中无效果
颜色对应的色号是来自系统的ansi对应的颜色值
设置光标行高亮显示
:set cursorline
:h 'cursorline'
:hi CursorLine
:hi CursorLine ctermbg=red ctermfg=white
:hi CursorLine
随着光标的运动,CursorLine 也会移动
设置光标行高亮显示
:set cursorcolumn
:h 'cursorcolumn'
:hi CursorColumn
:hi CursorColumn ctermbg=red ctermfg=white
:hi CursorColumn
随着光标的运动,CursorColumn 也会移动
如果有换行问题的话
:set nowrap

定义 oeasy 组
:hi oeasy ctermbg=white ctermfg=red
查看 oeasy 组
:hi oeasy
应用 oeasy 组
:set statusline=%#oeasy#%F%*

set statusline=%-040.40(%F%m%)%-030.30([%l,%c]%)%p%%
set laststatus=2
set ruler
set number
set showcmd
set nocompatible
set showcmd
set showmode
set history=100
set t_Co=256
colorscheme blue
set cursorline
hi CursorLine ctermbg=red ctermfg=white
set cursorcolumn
hi CursorColumn ctermbg=red ctermfg=white
我们这次深入了配色方案
修改了方案中的具体配色
建立了自己的配色
应用了自己的配色
配置里面还有什么好玩的吗?🤔
用来用去就是红绿蓝
可以有更多颜色吗?
下次再说 *