andersevenrud / nordic.nvim

A nord-esque colorscheme for neovim
MIT License
174 stars 12 forks source link

Alternative background for special buffers and certain extensions #46

Closed gegoune closed 2 years ago

gegoune commented 2 years ago

Mainly background style for buffers such nvim-tree, vista, undo-tree or quickfix (etc). Seems to be popular recently and I quite liked it in other colorschemes. What do you think?

andersevenrud commented 2 years ago

Could be added as an option maybe ? What do you think about this @maaslalani ?

maaslalani commented 2 years ago

I don't use any of those plugins/buffers (other than quickfix) so doesn't affect me, i think having a different background makes sense as long its not too drastic. If users complain, then could add an option like the minimal mode stuff. But yea up to you entirely, as long as it looks good 😄

gegoune commented 2 years ago

Absolutely could be an option. Would be nice if there was an option to specify what should be styled as well.

Example: https://github.com/folke/tokyonight.nvim/search?q=sidebars

andersevenrud commented 2 years ago

Would be nice if there was an option to specify what should be styled as well.

Indeed. Noted!

as long its not too drastic

Yeah... We'll definitively need a new color in the palette for this because the contrast will be rather extreme with the current choices imo (or maybe it's just because I'm totally not used to having different buffer backgrounds).


I'll look into this and get back to you @gegoune .

andersevenrud commented 2 years ago

Here are two variants based on the background color, but stepped down 1 and 2 steps respectively :thinking:


2021-11-29-195927_3840x2160_scrot 2021-11-29-195931_3840x2160_scrot


2021-11-29-200213_3840x2160_scrot 2021-11-29-200217_3840x2160_scrot

andersevenrud commented 2 years ago

Any preference ? Personally, I'm leaning towards the first variant because it's quite subtle.

maaslalani commented 2 years ago

I'm a fan of the first variant! Second one is a little too contrasting with the background.

gegoune commented 2 years ago

Either one works for me to be honest. Thank you very much for super quick implementation!

andersevenrud commented 2 years ago

I've opened a PR of this here: https://github.com/andersevenrud/nordic.nvim/pull/47

Just gotta figure out a nice way to add autocomands for special buffers because highlight groups doesn't cover things like the quickfix and terminals :thinking:

maaslalani commented 2 years ago

I've opened a PR of this here: #47

Just gotta figure out a nice way to add autocomands for special buffers because highlight groups doesn't cover things like the quickfix and terminals 🤔

You might need to check the filetype (filetype=qf)

andersevenrud commented 2 years ago

Yeah, it'll have to be an autocommand with the filetype set, which in turn sets the "Normal" highlight based on that. I think there's also a neovim native way to do this with set. I vaguely remember coming across this at some point.

maaslalani commented 2 years ago

Actually, maybe the QuickFixLine is what we need? and for terminal looks like Tokyonight uses an autocommand

andersevenrud commented 2 years ago

QuickFixLine is just the currently selected line in qf. I already tried this :sweat_smile:

But that autocommand has setlocal which was the thing I was vaguely remembering!

andersevenrud commented 2 years ago

The else-condition there also contains the recipe to cover terminal and a lot of other stuff as well. So thanks for that @maaslalani . I really wish that autocmd abstraction was a thing in the neovim Lua APIs by now, but seems like that won't land until 0.7 probably.... oh well :)

andersevenrud commented 2 years ago

@maaslalani That did the trick! PR was updated with these changes :smile:

andersevenrud commented 2 years ago

I have been running these changes all day and it all worked out, so I merged it. Keeping this open for a little bit in case there's any more places where this could be implemented.

gegoune commented 2 years ago

Thank you very much, was using it today too and it works well.

andersevenrud commented 2 years ago

Keeping this open for a little bit in case there's any more places where this could be implemented.

Think I caught everything in the PR. If not, let me know and I'll add it in quickly @gegoune .

I've also started making docs (https://github.com/andersevenrud/nordic.nvim/pull/51) on how all of this works, and I'll make sure to include how to do this alternate stuff there as well.

gegoune commented 2 years ago

Thank you very much @andersevenrud, loving the scheme! (Go Magnus!)