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

Possible to override `nord` variables outside the plugin? #315

Closed jasonlong closed 2 years ago

jasonlong commented 2 years ago

I have a modified version of nord-vim with the Polar Night grays shifted one slot darker each for contrast that I prefer. Is there a way to simplify this setup and just override these s:nord variables in my init.vim? I tried getting it to work with augroup/autocmd, but I didn't have much luck.

svengreb commented 2 years ago

Hi @jasonlong :wave:

Even if the plugin is already very dynamic in terms of certain themes configurations, one of the main points is exactly the use of the Nord color palette as it is. Otherwise this project would only be a kind of theme plugin template that can be used with any color palette (such projects exist, e.g. theme generators or lush.nvim). The syntax highlighting groups are especially optimized for the use with the Nord colors to achieve a consistent style across other Nord ports (e.g. JetBrains IDEs, VS Code etc.).

While global highlighting groups can be customized to override styles defined by this plugin the variables prefixed with s: are locally scoped to the script file in which they are defined ^1 (also see :help internal-variables for details in the official Vim documentation). This means they are only accessible when the plugin gets read while variables like highlighting groups are scoped to the global namespace by default (g:) and can therefore be modified, e.g. via augroup blocks.

In short: overriding Nord colors was never a goal for this plugin since it is optimized for the color palette. At the moment I also don't see any real benefit in implementing such a configuration, but the upcoming Neovim specific "Nord Neovim" port could make this possible because the possibilities with Lua are more flexible.

jasonlong commented 2 years ago

Thanks for the detailed response, @svengreb. I definitely wouldn't expect color variable overrides to be a supported feature. I was just curious if there was a way to not have to maintain a fork for my preferred grays.

I'll go ahead and close this out.