先胡乱地尝试一下修改颜色代码
hi Normal ctermfg=1
hi Normal ctermfg=2
hi Normal ctermfg=3
首先看看有多少能用的颜色
:set t_Co?
设置为 256 色的有颜色终端(cterm)显示模式
:set t_Co=256
那么这 256 种颜色都有什么呢?
我们尝试把他显示出来
echo -e "\033[48;5;1moeasy[0m"
echo -e "\033[48;5;2moeasy[0m"
echo -e "\033[48;5;3moeasy[0m"
echo -e "\033[48;5;4moeasy[0m"
echo -e "\033[48;5;5moeasy[0m"
#!/bin/bash
for c in {0..255}
do
printf "\033[48;5;"$c"m%5d\033[0m" $c
done
:w|!sh %
:hi Normal ctermbg=196
:hi Normal ctermbg=214
:hi Normal ctermbg=124
:TOhtml
:source $VIMRUNTIME/syntax/2html.vim
:firefox %
:set t_Co=256