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

Possible to override nord variables outside the plugin? #315

Closed
jasonlong opened this issue May 26, 2022 · 2 comments
Closed

Possible to override nord variables outside the plugin? #315

jasonlong opened this issue May 26, 2022 · 2 comments

Comments

@jasonlong
Copy link
Contributor

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
Copy link
Member

Hi @jasonlong 👋

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 2 (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.

Footnotes

  1. https://learnvimscriptthehardway.stevelosh.com/chapters/20.html

  2. https://developer.ibm.com/articles/l-vim-script-1/#values-and-variables

@jasonlong
Copy link
Contributor Author

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.

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

3 participants