andersevenrud / nordic.nvim

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

Question regarding delta #61

Closed gegoune closed 2 years ago

gegoune commented 2 years ago

Apologies for it not being anyhow related to this colorscheme. Have spent hours trying to get delta (https://github.com/dandavison/delta) look decent/same as diff in nvim but am failing miserably. Wanted to ask if you do use it by any chance and have some nice nordic configuration for it? It's fine if you just close it without even saying a word, apologies for overstepping!

andersevenrud commented 2 years ago

Just browsing their source it seems that they have a Nord syntax. Try delta --syntax-theme=Nord :)

If that's not what you're after I could take a look at setting something up for you.

gegoune commented 2 years ago

Ah, that's amazing! Thanks, I did look at colours from delta --show-syntax-themes and even searched for nord! No idea why I didn't find it. Thanks!

Edit: I know why! I used terminal's search option rather than pager's one. Did not notice it was a pager. :)

That solves half of the problem only though.

Screenshot 2022-01-06 at 23 15 10

You can see how very much not nordic are those highlights for diffs.

andersevenrud commented 2 years ago

Stand by... I'll put something together.

andersevenrud commented 2 years ago

The hard part here is to get a neutral background color for those lines, i.e {plus, minus}-style :sweat_smile:

Try this one and see if its to your liking. If not I'll spend a bit more time tuning that.

[delta "nordic"]
  commit-decoration-style = bold
  dark = true
  file-decoration-style = none
  file-style = omit
  hunk-header-decoration-style = "#3b4252"
  hunk-header-file-style = "#d8dee9"
  hunk-header-line-number-style = bold "#a3be8c"
  hunk-header-style = file line-number syntax
  line-numbers = true
  line-numbers-left-style = "#3b4252"
  line-numbers-minus-style = "#bf616a"
  line-numbers-plus-style = "#a3be8c"
  line-numbers-right-style = "#3b4252"
  line-numbers-zero-style = "#d8dee9"
  minus-emph-style = normal "#bf616a"
  minus-style = normal "#4e4252"
  plus-emph-style = syntax "#a3be8c"
  plus-style = syntax "#3b5952"
  syntax-theme = Nord
andersevenrud commented 2 years ago

FYI the nordic vim diff background color is #3b4252 if you don't want the red/green line highlight :)

gegoune commented 2 years ago

Oh wow, very nice! Thank you so much!

Only issue I am seeing without digging in too much is plus-style:

Screenshot 2022-01-06 at 23 49 57 Screenshot 2022-01-06 at 23 51 50

And (that's easy) maybe white line numbers could be tuned down a bit?

I think I like to keep those backgrounds, they really help to see things quickly. This is the part I struggled the most!

andersevenrud commented 2 years ago

Does this improve things ?

[delta "nordic"]
  commit-decoration-style = bold
  dark = true
  file-decoration-style = none
  file-style = omit
  hunk-header-decoration-style = "#3b4252"
  hunk-header-file-style = "#c2cbdb"
  hunk-header-line-number-style = bold "#525f46"
  hunk-header-style = file line-number syntax
  line-numbers = true
  line-numbers-left-style = "#3b4252"
  line-numbers-minus-style = "#bf616a"
  line-numbers-plus-style = "#525f46"
  line-numbers-right-style = "#3b4252"
  line-numbers-zero-style = "#c2cbdb"
  minus-emph-style = normal "#bf616a"
  minus-style = normal "#4e4252"
  plus-emph-style = syntax "#525f46"
  plus-style = syntax "#3b5952"
  syntax-theme = Nord

The main issue here is that with syntax enabled and without dynamic coloring options, there's pretty much no way to make this work perfectly purely with the standard terminal/vim palette.

andersevenrud commented 2 years ago

I had a mistake there...

  hunk-header-line-number-style = bold "#a3be8c"
  line-numbers-plus-style = "#a3be8c"
andersevenrud commented 2 years ago

without dynamic coloring options

I'm stupid... it's obvious that it's possible to disable the syntax, lol. So if you want the OG green color and you can read that with white, then this should do:

  plus-emph-style = normal "#a3be8c"
gegoune commented 2 years ago

Ah, I see, it makes sense. It's not the prettiest green now but at least can see though background now.

Couldn't read the original one though (Can you? Really?) so opted for dark-on-light plus-emph-style = black "#a3be8c"

For some reason though when doing git add --path(1) I get nice line colours:

Screenshot 2022-01-07 at 00 30 21

but in git diff it looks like:

Screenshot 2022-01-07 at 00 30 48

Would there really be different settings for those two scenarios?

Thank you so so much!

1) you would need:

[interactive]
  diffFilter = delta --color-only
andersevenrud commented 2 years ago

Couldn't read the original one though (Can you? Really?) so opted for dark-on-light plus-emph-style = black "#a3be8c"

Ah, nice! That's much clearer. And yeah, I could see it just fine. That could change though, because I use different color filters on my monitor based on time :sweat_smile:

Would there really be different settings for those two scenarios?

This was solved with the you woild need, right ?

gegoune commented 2 years ago

Would there really be different settings for those two scenarios?

This was solved with the you woild need, right ?

Unfortunately not, it was just a requirement for getting git add --patch work with delta.

andersevenrud commented 2 years ago

Oh, okay.

I've been using git diff the entire time while testing this and this is my entire config:

[delta "nordic"]
  commit-decoration-style = bold
  dark = true
  file-decoration-style = none
  file-style = omit
  hunk-header-decoration-style = "#3b4252"
  hunk-header-file-style = "#c2cbdb"
  hunk-header-line-number-style = bold "#a3be8c"
  hunk-header-style = file line-number syntax
  line-numbers = true
  line-numbers-left-style = "#3b4252"
  line-numbers-minus-style = "#bf616a"
  line-numbers-plus-style = "#a3be8c"
  line-numbers-right-style = "#3b4252"
  line-numbers-zero-style = "#c2cbdb"
  minus-emph-style = normal "#bf616a"
  minus-style = normal "#4e4252"
  plus-emph-style = black "#a3be8c"
  plus-style = syntax "#3b5952"
  syntax-theme = Nord

[core]
  pager = delta

[interactive]
  diffFilter = delta --color-only

[delta]
  navigate = true
  features = nordic

[merge]
  conflictstyle = diff3

[diff]
  colorMoved = default
gegoune commented 2 years ago

Aha! It's (colours for line numbers) different if you add side-by-side feature for whatever reason.

andersevenrud commented 2 years ago

I don't see any difference when I add side-by-side and use git diff :thinking:

andersevenrud commented 2 years ago

FYI

$ delta --version
delta 0.11.3
gegoune commented 2 years ago

You need to activate side-by-side view:

[delta]
  navigate = true
  features = nordic side-by-side
andersevenrud commented 2 years ago

Shouldn't that be like this though ? That's what I've tested.

[delta]
  navigate = true
  features = nordic
  side-by-side = true
gegoune commented 2 years ago

Very interesting! It must have changed in some version with old option still available but not working properly any longer? Or maybe I was setting it wrong for years… Oh well, doesn't matter as it works now just perfectly.

I am so thankful for your time today. You are the best! Tusen takk!

andersevenrud commented 2 years ago

Hey, at least it works now!

Du er velkommen :)