Skip to content

Commit 715c554

Browse files
committed
BREAKING_CHANGE: set lualine theme with theme="auto"
check updated docs at https://github.com/projekt0n/github-nvim-theme/blob/main/LUALINE.md
1 parent 7ed3408 commit 715c554

11 files changed

+95
-55
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1616
- refactor: implement highlight override function in `util.load`
1717
- enhance: `overrides` function is now able to add custom highlight in `dev` mode.
1818
- docs: about developer mode
19+
- breaking-change: set lualine theme with `theme="auto"`
1920

2021
### Fixes
2122

LUALINE.md

+12-12
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
To enable the `github` theme for `Lualine`, simply specify it in your lualine settings **after theme settings**:
1+
To enable the `github` theme for `Lualine`, simply specify it in your lualine settings **after theme settings**:A
22

33
### packer
44

@@ -9,7 +9,7 @@ use {
99
config = function()
1010
require("lualine").setup {
1111
options = {
12-
theme = "github" -- or "auto"
12+
theme = "auto" -- or you can assign github_* themes individually.
1313
-- ... your lualine config
1414
}
1515
}
@@ -32,7 +32,7 @@ use {
3232
lua << EOF
3333
require('lualine').setup {
3434
options = {
35-
theme = 'github', -- or "auto"
35+
theme = "auto" -- or you can assign github_* themes individually.
3636
-- ... your lualine config
3737
}
3838
}
@@ -44,63 +44,63 @@ EOF
4444
```lua
4545
require('lualine').setup {
4646
options = {
47-
theme = 'github', -- or "auto"
47+
theme = "auto" -- or you can assign github_* themes individually.
4848
-- ... your lualine config
4949
}
5050
}
5151
```
5252

53-
### Screenshots
53+
### Lualine Themes
5454

55-
#### dark
55+
#### github_dark
5656

5757
![normal](https://imgur.com/zBRwlUm.png)
5858
![insert](https://imgur.com/n5DG48e.png)
5959
![visual](https://imgur.com/MWQXJLD.png)
6060
![command](https://imgur.com/HGIYVSN.png)
6161
![terminal](https://imgur.com/pEWjIJ8.png)
6262

63-
#### dimmed
63+
#### github_dimmed
6464

6565
![normal](https://imgur.com/R800MhA.png)
6666
![insert](https://imgur.com/42M0X0O.png)
6767
![visual](https://imgur.com/euIfZtW.png)
6868
![command](https://imgur.com/E4tzBCD.png)
6969
![terminal](https://imgur.com/RASnrFw.png)
7070

71-
#### dark_default
71+
#### github_dark_default
7272

7373
![normal](https://imgur.com/yHa1cK1.png)
7474
![insert](https://imgur.com/mMX2364.png)
7575
![visual](https://imgur.com/SNwhnph.png)
7676
![command](https://imgur.com/aLifoAv.png)
7777
![terminal](https://imgur.com/Q7mG5m8.png)
7878

79-
#### dark_colorblind
79+
#### github_dark_colorblind
8080

8181
![normal](https://imgur.com/yHa1cK1.png)
8282
![insert](https://imgur.com/mMX2364.png)
8383
![visual](https://imgur.com/SNwhnph.png)
8484
![command](https://imgur.com/aLifoAv.png)
8585
![terminal](https://imgur.com/Q7mG5m8.png)
8686

87-
#### light
87+
#### github_light
8888

8989
![normal](https://imgur.com/om8f3S5.png)
9090
![insert](https://imgur.com/qawZ4G6.png)
9191
![visual](https://imgur.com/3j3ThxU.png)
9292
![command](https://imgur.com/ItcANVN.png)
9393
![terminal](https://imgur.com/8SgNyIU.png)
9494

95-
#### light_default
95+
#### github_light_default
9696

9797
![normal](https://imgur.com/lwTCVXc.png)
9898
![insert](https://imgur.com/zh9uPGS.png)
9999
![visual](https://imgur.com/e3xYvfu.png)
100100
![command](https://imgur.com/TrjrA3i.png)
101101
![terminal](https://imgur.com/7ukHRhL.png)
102102

103-
#### light_colorblind
103+
#### github_light_colorblind
104104

105105
![normal](https://imgur.com/lwTCVXc.png)
106106
![insert](https://imgur.com/zh9uPGS.png)

lua/github-theme/plugins/lualine.lua

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
local util = require('github-theme.util')
2+
3+
local lualine = {}
4+
5+
--- build lualine theme for github theme
6+
---@param c gt.ColorPalette
7+
lualine.build_lualine_theme = function(c)
8+
--- create lualine group colors for github-theme
9+
---@param color string
10+
---@return table
11+
local tint_lualine_group = function(color)
12+
local group = {
13+
a = { bg = color, fg = c.bg },
14+
b = { bg = util.darken(color, 0.2), fg = util.lighten(color, 0.2) },
15+
}
16+
if vim.o.background == 'dark' then
17+
group.c = {
18+
bg = util.darken(color, 0.01, c.bg2),
19+
fg = util.lighten(color, 0.4, c.fg),
20+
}
21+
else
22+
-- inverting colors for light colorschemes
23+
group.c = {
24+
bg = util.lighten(color, 0.01, c.bg2),
25+
fg = util.darken(color, 0.4, c.fg),
26+
}
27+
end
28+
return group
29+
end
30+
31+
local inactive_hi = { bg = c.bg2, fg = util.darken(c.fg, 0.3) }
32+
return {
33+
normal = tint_lualine_group(c.blue),
34+
insert = tint_lualine_group(c.green),
35+
command = tint_lualine_group(c.bright_magenta),
36+
visual = tint_lualine_group(c.yellow),
37+
replace = tint_lualine_group(c.red),
38+
terminal = tint_lualine_group(c.orange),
39+
inactive = {
40+
a = inactive_hi,
41+
b = inactive_hi,
42+
c = inactive_hi,
43+
},
44+
}
45+
end
46+
47+
return lualine

lua/lualine/themes/github.lua

-43
This file was deleted.

lua/lualine/themes/github_dark.lua

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
local colors = require('github-theme.colors')
2+
local lualine = require('github-theme.plugins.lualine')
3+
4+
local c = colors.setup({ theme_style = 'dark' })
5+
return lualine.build_lualine_theme(c)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
local colors = require('github-theme.colors')
2+
local lualine = require('github-theme.plugins.lualine')
3+
4+
local c = colors.setup({ theme_style = 'dark_colorblind' })
5+
return lualine.build_lualine_theme(c)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
local colors = require('github-theme.colors')
2+
local lualine = require('github-theme.plugins.lualine')
3+
4+
local c = colors.setup({ theme_style = 'dark_default' })
5+
return lualine.build_lualine_theme(c)

lua/lualine/themes/github_dimmed.lua

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
local colors = require('github-theme.colors')
2+
local lualine = require('github-theme.plugins.lualine')
3+
4+
local c = colors.setup({ theme_style = 'dimmed' })
5+
return lualine.build_lualine_theme(c)

lua/lualine/themes/github_light.lua

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
local colors = require('github-theme.colors')
2+
local lualine = require('github-theme.plugins.lualine')
3+
4+
local c = colors.setup({ theme_style = 'light' })
5+
return lualine.build_lualine_theme(c)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
local colors = require('github-theme.colors')
2+
local lualine = require('github-theme.plugins.lualine')
3+
4+
local c = colors.setup({ theme_style = 'light_colorblind' })
5+
return lualine.build_lualine_theme(c)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
local colors = require('github-theme.colors')
2+
local lualine = require('github-theme.plugins.lualine')
3+
4+
local c = colors.setup({ theme_style = 'light_default' })
5+
return lualine.build_lualine_theme(c)

0 commit comments

Comments
 (0)