mhartington / oceanic-next

Oceanic Next theme for neovim
Other
1.13k stars 141 forks source link

Transparancy Issue #99

Closed ialsaffar closed 3 years ago

ialsaffar commented 3 years ago

First, I love this color scheme. Thank you for providing it!

Problem summary

I use transparency in Alacritty terminal. I'm able to get transparency in vim/nvim with other color-schemes by including the following line after colorscheme in my init.vim:

hi Normal guibg=NONE ctermbg=NONE

(I also set my terminal color-scheme to oceanic-next from this)

When I tried doing the same with oceanic-next, I got transparency on non-empty lines. However, the end of buffer area was still opaque (see screenshot). I know this is not necessarily a problem with your code. I'm wondering if what I'm doing is the best way to incorporate transparency with NeoVim and oceanic-next. It would be great if the scheme would account for this option.

Expected

All background becomes transparent.

Environment

Minimal vimrc

call plug#begin('$HOME/.local/share/nvim/plugged')
    Plug 'mhartington/oceanic-next'
call plug#end()

set cursorline
set number
syntax on

" This sets true color for Alacritty
let &t_8f = "\<esc>[38:2:%lu:%lu:%lum"
let &t_8b = "\<esc>[48:2:%lu:%lu:%lum"
set termguicolors

colorscheme OceanicNext

" This usually makes vim transparent
hi Normal guibg=NONE ctermbg=NONE

set runtimepath+=~/.local/share/nvim/plugged/oceanic-next

To reproduce:

  1. Use Alacritty with the following in $HOME/.config/alacritty/alacritty.yml:
    • background_opacity: .75
  2. Install vim-plug
  3. Use included init.vim
  4. Install oceanic-next
  5. Open a file in nvim
  6. In normal mode, enter G zz to see an empty end-of-buffer area

Workaround

With some trial-and-error, I was able to get transparency working by editing lines 98, 99 in OceanicNext.vim as follows:

call s:hi('EndOfBuffer', s:base05, s:none, '', '')
call s:hi('EndOfBuffer', s:base05, s:none, '', '')

Not sure if this is correct or if it has side-effects. After making this edit, the scheme seems to be working as expected (with or without hi Normal guibg=NONE ctermbg=NONE). I don't know a lot about this, but I'm wondering if setting these colors to base00 is necessary.

I'm happy to do a pull request with these changes and update the README.md to include transparency as a feature for terminals that support it.

Screen shot

nvim-oceanic-next

mhartington commented 3 years ago

Yeah, I'd rather keep those in the theme. I'd gladly merge a PR that adds a note for this to the readme.

ialsaffar commented 3 years ago

Understandable, as this seems to be outside the scope of the color-scheme. Readme pull request created!