From 5ec55f35744239e6a25ed651c5b87335a04653b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yaroslav=20de=20la=20Pe=C3=B1a=20Smirnov?= Date: Tue, 20 Sep 2022 19:09:56 +0300 Subject: Edit colorscheme to allow for non-"opaque" bg With this option, now it is possible to not set the text background and use instead the terminal's one background, for example, if one wants to use a terminal with transparency. --- dotfiles/.config/nvim/init.vim | 5 ++++- dotfiles/.local/share/nvim/site/colors/ultramar.vim | 19 ++++++++++++++----- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/dotfiles/.config/nvim/init.vim b/dotfiles/.config/nvim/init.vim index af02383..f2525d3 100644 --- a/dotfiles/.config/nvim/init.vim +++ b/dotfiles/.config/nvim/init.vim @@ -8,6 +8,8 @@ if empty(glob('~/.local/share/nvim/site/autoload/plug.vim')) autocmd VimEnter * PlugInstall --sync | source $MYVIMRC endif +" TODO: bind to insert datetime + call plug#begin('~/.local/share/nvim/site/plugged') Plug 'junegunn/goyo.vim' Plug 'PotatoesMaster/i3-vim-syntax' @@ -47,8 +49,9 @@ call plug#end() set number " Colors - colorscheme ultramar let g:ultramar_italic=1 + let g:ultramar_opaque_bg=0 + colorscheme ultramar if $COLORSCHEME == "light" set background=light endif diff --git a/dotfiles/.local/share/nvim/site/colors/ultramar.vim b/dotfiles/.local/share/nvim/site/colors/ultramar.vim index c092c20..ae89c28 100644 --- a/dotfiles/.local/share/nvim/site/colors/ultramar.vim +++ b/dotfiles/.local/share/nvim/site/colors/ultramar.vim @@ -29,6 +29,7 @@ endif if !exists('g:ultramar_bold') let g:ultramar_bold=1 endif + if !exists('g:ultramar_italic') if has('gui_running') || $TERM_ITALICS == 'true' let g:ultramar_italic=1 @@ -36,12 +37,15 @@ if !exists('g:ultramar_italic') let g:ultramar_italic=0 endif endif + if !exists('g:ultramar_undercurl') let g:ultramar_undercurl=1 endif + if !exists('g:ultramar_underline') let g:ultramar_underline=1 endif + if !exists('g:ultramar_inverse') let g:ultramar_inverse=1 endif @@ -65,6 +69,9 @@ endif if !exists('g:ultramar_invert_indent_guides') let g:ultramar_invert_indent_guides=0 endif +if !exists('g:ultramar_opaque_bg') + let g:ultramar_opaque_bg=1 +endif let s:is_dark=(&background == 'dark') @@ -137,8 +144,6 @@ endif " }}} " Setup Colors: {{{ -let s:vim_bg = ['bg', 'bg'] -let s:vim_fg = ['fg', 'fg'] let s:none = ['NONE', 'NONE'] " determine relative colors @@ -424,7 +429,11 @@ call s:HL('UltramarAquaSign', s:aqua, s:sign_column, s:invert_signs) " General UI: {{{ " Normal text -call s:HL('Normal', s:fg1, s:bg0) +if g:ultramar_opaque_bg == 1 + call s:HL('Normal', s:fg1, s:bg0) +else + call s:HL('Normal', s:fg1) +endif " Correct background (see issue #7): " --- Problem with changing between dark and light on 256 color terminal @@ -541,8 +550,8 @@ else endif call s:HL('Comment', s:gray, s:none, s:italicize_comments) -call s:HL('Todo', s:vim_fg, s:vim_bg, s:bold . s:italic) -call s:HL('Error', s:red, s:vim_bg, s:bold . s:inverse) +call s:HL('Todo', s:fg0, s:bg0, s:bold . s:italic) +call s:HL('Error', s:red, s:bg0, s:bold . s:inverse) " Generic statement hi! link Statement UltramarRed -- cgit v1.2.3