Skip to content

a workaround before `termguiattr`. `termguiattr`之前的临时解决方案。

Notifications You must be signed in to change notification settings

rwxe/termguiattrhook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

Introduction

简介

This plugin is used to override cterm attributes with gui attributes for all highlight groups. A workaround before 'termguiattr'.

这个插件用于对所有高亮组使用gui属性重写所有cterm属性。'termguiattr'之前的临时解决方案。

Installation

安装

If you use a plugin manager, such as vim-plug, add the following line to your ~/.vimrc and execute :PlugInstall.

如果你使用插件管理,例如vim-plug,将下面这行文字添加到你的~/.vimrc中并执行:PlugInstall

call plug#begin('~/.vim/plugged')
Plug 'rwxe/termguiattrhook'
call plug#end()

Or you can directly clone this repository and put the plugin file into the vim plugin directory, like this ~/.vim/pluggin/termguiattrhook. Or because the plugin code is very simple, you can directly paste the code of termguiattrhook.vim into your ~/.vimrc.

或是你可以直接克隆本仓库,将插件文件放入到vim插件目录,像这样~/.vim/pluggin/termguiattrhook。或是因为这个插件代码很简单,你可以直接将termguiattrhook.vim的代码粘贴到你的~/.vimrc中。

Usage and Configuration

用法和配置

CHECK English Help Documentation, or run :help termguiattrhook after installing the plguin.

中文帮助文档,或是安装插件完后运行:help termguiattrhook

Effect

效果

This plugin will achieve the following effects. For a highlighted group, if the gui attribute is set, it will be overridden to cterm, otherwise it will not be processed.

此插件将做到如下效果。对一个高亮组,如果设置了gui属性,则重写到cterm,否则不处理。

hi Test0 term=standout cterm=bold,underline  gui=undercurl,strikethrough,italic "cterm set,gui set              
hi Test1 term=standout cterm=bold,underline  gui=none                           "cterm set,gui didn't set       
hi Test2 term=standout cterm=none gui=undercurl,strikethrough,italic,bold       "cterm didn't set,gui set       
hi Test3 term=standout cterm=none gui=none                                      "cterm didn't set,gui didn't set                                                          

After calling

调用后

Test0          xxx term=standout cterm=undercurl,italic,strikethrough gui=undercurl,italic,strikethrough
Test1          xxx term=standout cterm=bold,underline
Test2          xxx term=standout cterm=bold,undercurl,italic,strikethrough gui=bold,undercurl,italic,strikethrough
Test3          xxx term=standout

About

a workaround before `termguiattr`. `termguiattr`之前的临时解决方案。

Resources

Stars

Watchers

Forks