Closed squarefrog closed 10 years ago
Great :smile:
With these changes my diffs look worse when viewing git changes with the Tomorrow-Night-Bright theme. See the difference between the two screenshots.
Commit 86486d4:
Commit eaa5f94:
I had that bug when viewing running git commit without passing a message. I patched it in a standalone version I run https://github.com/squarefrog/tomorrow-night.vim/commit/11875fcfd9efb31e45602bb0bdab6c578dd9306e But haven't had chance to make the changes here yet. Take a look and submit a PR!
Those two lines in that commit I referenced will just work in any of the tomorrow themes so should be a fine fix for you.
Thanks, Paul. So this change should be applied to all themes I guess?
Yes - it can safely be added across all themes as it uses the built in red/green colors. My original patch concerns looking at the diff between two files either by launching with vimdiff or diff this
There are actually a whole bunch of git attributes in vim but I couldn't figure out how most would be useful.
Alright, I'll whip something up!
Awesome! If you get stuck or something looks wierd give me a shout.
@squarefrog Now that I have your attention :-), I noticed that when editing a Git commit message, the theme does not give the first 50 characters of the first line special significance (i.e. bold) like some other themes do. Do you how to do that?
Do you have any examples? It sounds reasonably trivial, if a bit opinionated.
I believe the canonical source of the "rule" is a post by Tim Pope from 2008, but the format is pretty popular -- at least where I come.
See for example this commit message in the darkburn theme:
My immediate guess is that the git plugin possibly supports this and has a property available. I can look tomorrow as there is a vim function that says what hl group matches under the cursor.
Good tip, I think I got it:
syn match gitcommitFirstLine "\%^[^#].*" nextgroup=gitcommitBlank skipnl
syn match gitcommitSummary "^.\{0,50\}" contained containedin=gitcommitFirstLine nextgroup=gitcommitOverflow contains=@Spell
syn match gitcommitOverflow ".*" contained contains=@Spell
syn match gitcommitBlank "^[^#].*" contained contains=@Spell
And so this line will make the first 50 characters of the commit summary bold:
hi gitcommitSummary cterm=bold
Yeah that'd do it! So I don't know if that last line would work in these themes, or if you may need
call <SID>X("gitcommitSummary", "", "", "bold")
I think just making it bold, and not changing the colours is a nice touch as it's subtle but noticeable.
Create pull request #262. Thanks again @squarefrog. Have a good evening!
The default settings for diffs look fine when using Tomorrow. But if you use another theme like Tomorrow-Night, then it looks hideous:
This pull request fixes the look in each of the alternative schemes.
Tomorrow-Night
Tomorrow-Night-Blue
Tomorrow-Night-Bright
Tomorrow-Night-Eighties
The default Tomorrow theme is left as is, because it looks fine with the default settings