Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Selection won't change color in neovim on alacritty #250

Closed
glyh opened this issue Feb 19, 2021 · 3 comments
Closed

Selection won't change color in neovim on alacritty #250

glyh opened this issue Feb 19, 2021 · 3 comments

Comments

@glyh
Copy link

glyh commented Feb 19, 2021

screenshot

2021-02-19_13-41

vim-plug's snapshot output

silent! let g:plugs['nord-vim'].commit = 'ea7ff9c343392ec6dfac4e9ec3fe0c45afb92a40'

neovim version

:version
NVIM v0.4.4
Build type: Release
LuaJIT 2.0.5
Compilation: /usr/bin/cc -D_FORTIFY_SOURCE=2 -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
-O2 -DNDEBUG -DMIN_LOG_LEVEL=3 -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -
Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=always -DINCLUDE_GENERATE
D_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -I/build/neovim/src/build/config -I/build/neovim/
src/neovim-0.4.4/src -I/usr/include -I/build/neovim/src/build/src/nvim/auto -I/build/neovim/src/build/include
Compiled by builduser

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/share/nvim"

minimal init.vim to reproduce the problem:

call plug#begin('~/.vim/plugged')
Plug 'arcticicestudio/nord-vim' " colorscheme
call plug#end()
colorscheme nord
@arcticicestudio
Copy link
Contributor

arcticicestudio commented Sep 26, 2021

Hi @glyh 👋

Thanks for the minimal reproduction configuration. Can you please add the following and test again?

set nocompatible
if (has("termguicolors"))
  set termguicolors
endif

syntax enable

As you can see in the example configuration I've added the termguicolors settings which could be one reason why the color is not rendered correctly. This is because the *_term attributes make use of the colors that are provided by the terminal color scheme, e.g. Alacritty in your case. The *_gui variables on the other side are used when Vim runs in GUI mode. So in order to run Vim in a terminal but use colors like in GUI mode the termguicolors variable must be set and your terminal emulator must support “true colors“ (24bit). This could fix the comment color not being brightened (see nordtheme/nord#94 for details) and the missing selection color.

I also remember that Alacritty uses custom terminfo definitions which might be necessary to set up properly.

@arcticicestudio
Copy link
Contributor

@glyh Have you been able to solve the problem? If yes it would be nice if you could summarize your solution to help others who are facing the same problem.

@glyh
Copy link
Author

glyh commented Nov 19, 2021

Sorry for delay so long time, I've tested the code above and it fixes this problem. Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants