nordtheme / vim

An arctic, north-bluish clean and elegant Vim theme.
https://www.nordtheme.com/ports/vim
MIT License
2.52k stars 274 forks source link

Comments are still pretty unreadable #195

Closed stefanfrede closed 4 years ago

stefanfrede commented 4 years ago

Hi! I like the Nord colours a lot and I use them for mostly everything CLI related. Great work! The only problem I have is that I'm more or less flying blind when writing comments. Luckily I'm able to touch type ;) I just read through the issues and release notes and learned that there already went a lot of effort into this topic. But I'm wondering, when I compare my screen with how it is supposed to look after the 0.10.0 release I get the feeling that I have still have the old colours even though I installed the latest release (0.13.0). My terminal is Kitty and here is a screenshot:

nord-vim 0.13.0 in Kitty terminal

arcticicestudio commented 4 years ago

Hi @stefanfrede :wave:, guessing color values from screenshots is hard (and inaccurate due to color profiles differences), but this looks indeed not as bright as it should be. Could you please post your current Vim configuration (default is the .vimrc file in your home directory) so I can try to reproduce it? Might also be related to the terminal (Kitty), unfortunately there are often differences in the way colors are handled and rendered between different terminals. I've tested it on iTerm2 (macOS) and Tilix (Arch Linux with GNOME) and it works fine with a clean configuration, but there can be many other reasons like configuration options or other plugins that cause this inconsistency.

stefanfrede commented 4 years ago

You can find my dotfiles here: https://gitlab.com/stefanfrede/dotfiles/-/tree/update-vim-config and my .vimrc in particular here https://gitlab.com/stefanfrede/dotfiles/-/blob/update-vim-config/vim/.vimrc.

alecandido commented 4 years ago

I have the same issue of @stefanfrede , using nordtheme both for vim and st terminal (with a further alpha=0.94 for st), and it's wonderful, thank you for your work.

Currently I adopted the solution you suggested in #196 , but white comments are really bad, so I opted for ctermfg=242 for Comment (same for LineNr).

1) do you have any suggestion for a dark colour better integrated with the palette but still readable? 2) for consistency: is there a way to customize directly the variable s:nord3_term without touching the plugin file colors/nord.vim? (my personal answer is no currently, but I don't have so much experience with vimscript and vim config files)

arcticicestudio commented 4 years ago

@stefanfrede Could you please try to add the following option to your configuration?

if (has("termguicolors"))
  set termguicolors
endif
arcticicestudio commented 4 years ago

@AleCandido Thanks, nice to see you like it :smile: Could you also please try if it works when setting the termguicolors option?

  1. I can only think of one color from the snow storm palette, otherwise any HEX color that is similar to the current comment color (requires the termguicolors option in order to work in terminal mode).
  2. The s: means the variable is scoped to the script is was declared in so there's no way to modify it from the outside. I'm also not a Vim script "pro" at all and also need to read docs again and again when the theme or my setup requires changes, but it's normal to not being able to know and write 10+ different languages :smile: There are nice resources like Vim syntax cheat sheets to get things done.
stefanfrede commented 4 years ago

@arcticicestudio That solved it. Thank you!

alecandido commented 4 years ago

Sorry to reply late.

First things first: I tried with your solution, but unfortunately is not working, set termguicolors is screwing up all the colors, and turn them all to white.

Then:

  1. of course hex colors are not available, so my first guess ctermfg=242 is still my favorite choice, but I would have preferred slightly more bluish, instead of flatly grey
  2. for sure I'm not an expert of Vim script, and I thank you also for the reference (I looked at others but that one seems really promising), other than for your work, but don't you think that making also colors customizable from outside can be a good idea?
    • it would be fine to have a hook somewhere to replace colors that for some reasons (terminal background or whatever) don't fit for a specific user
    • the theme is still useful because it's a guideline and still decide what have the same color and what a different one, and make most part of the job
    • for sure it's not a priority, the theme it's fine on its own :smile:

Thank you for your reply, at least the reference was useful and I keep using your theme :+1: .

arcticicestudio commented 4 years ago

@AleCandido Sorry, I missed your comment because the issue was closed and I've marked it as done in the GitHub notification center.

It's possible that you're using a terminal that doesn't work out-of-the-box with 24-bit colors so in order to use the termguicolors option some additional steps are required. For example, see https://github.com/arcticicestudio/nord-emacs/issues/59#issuecomment-503738384 which describes that the kitty terminal requires a extra terminfo file. What is the output when you run echo $TERM? Maybe you'd also like to check out the great Gist about colors in terminals, there are many information why colors are still sometimes a pain in terminals.

Regarding the customizable colors: I guess the reason to use a theme are the colors and how they are combined so making them configurable is more like rebuilding Vim's theme engine 🙃The current way of allowing users to customize any highlighting group is a powerful tool and allows to change parts of the theme to any other color. It also ensures that the modifications are only scoped to the Nord theme and doesn't effect others. This is also valid for any other Vim option, so e.g. in your case the `termguicolors_ option can only be set when Nord is currently the active theme. This would make sure nothing breaks for other themes.

alecandido commented 4 years ago

Don't worry to be late, it's fine:

Thank you again