The idea is that by using set termguicolors in Vim, I should get the colorscheme (gruvbox) to look in my terminal (st, has true color support) exactly like in GVim. But all I get is white text on black background.
The part in vimrc which sets the colorscheme:
set background=dark
colorscheme gruvbox
set termguicolors
Run Code Online (Sandbox Code Playgroud)
yol*_*yer 17
你可能会读:h xterm-true-color。
我st也在使用,实际上,设置只termguicolors给了我黑色和白色。
但是按照帮助中的建议,我添加了以下内容:
let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"
let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"
Run Code Online (Sandbox Code Playgroud)
然后颜色又出现了。希望它能有所帮助。
以下是全文摘录:h xterm-true-color:
Vim 支持在终端中使用真彩色(取自 |highlight-guifg| 和 |highlight-guibg|),前提是终端支持这一点。为了使这项工作起作用,需要设置 'termguicolors' 选项。有关支持真彩色的终端列表,请参阅https://gist.github.com/XVilka/8346728。
有时设置 'termguicolors' 是不够的,必须设置 |t_8f| 和 |t_8b| 选项明确。这些选项缺省值是“^ [[38; 2;%璐;%lu个;%LUM”和“^ [[48; 2;%璐;%lu个;%LUM”分别但它仅设定时
$TERM是xterm. 一些终端接受相同的序列,但所有分号都替换为冒号(这实际上更兼容,但支持较少):Run Code Online (Sandbox Code Playgroud)let &t_8f = "\<Esc>[38:2:%lu:%lu:%lum" let &t_8b = "\<Esc>[48:2:%lu:%lu:%lum"这些选项包含 printf 字符串,带有 |printf()| (实际上,它的 C 等效因此
l修饰符)使用 t_ 选项值和三个无符号长整数调用,这些整数可能具有 0 到 255(含)之间的任何值,分别代表红色、绿色和蓝色。
| 归档时间: |
|
| 查看次数: |
8499 次 |
| 最近记录: |