File tree Expand file tree Collapse file tree 3 files changed +30
-0
lines changed
Expand file tree Collapse file tree 3 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,8 @@ au User LumenLight echom 'Entered light mode'
4848au User LumenDark echom 'Entered dark mode'
4949```
5050
51+ Note that for the common usecase of switching the colorscheme, there are the ` g:lumen_light_colorscheme ` and ` g:lumen_dark_colorscheme ` variables.
52+
5153## What are some good light colorschemes?
5254
5355There are not many colorschemes that work well both in light and dark mode.
Original file line number Diff line number Diff line change @@ -20,7 +20,17 @@ func lumen#init()
2020 augroup END
2121endfunc
2222
23+ func lumen#apply_colorscheme (mode )
24+ " apply colorscheme from g:lumen_light_colorscheme/g:lumen_dark_colorscheme
25+ let v = get (g: , printf (" lumen_%s_colorscheme" , a: mode ), ' ' )
26+ if len (v ) && get (g: , ' colors_name' , ' ' ) != v
27+ exe printf (" colorscheme %s" , v )
28+ endif
29+ endfunc
30+
2331func lumen#light_hook ()
32+ call lumen#apply_colorscheme (' light' )
33+
2434 if s: background == ' light' && &background == s: background
2535 return
2636 endif
@@ -33,6 +43,8 @@ func lumen#light_hook()
3343endfunc
3444
3545func lumen#dark_hook ()
46+ call lumen#apply_colorscheme (' dark' )
47+
3648 if s: background == ' dark' && &background == s: background
3749 return
3850 endif
Original file line number Diff line number Diff line change @@ -54,6 +54,22 @@ CONFIGURATION *lumen-configure*
5454 will no longer influence vim's internal detection mechanism at
5555 startup.
5656
57+ g:lumen_light_colorscheme *g:lumen_light_colorscheme*
58+ This variable defines the colorscheme to change to (if any),
59+ when the system switches to light mode. For a more generic
60+ callback, consult | User_LumenLight | .
61+ For example `let g:lumen_light_colorscheme = 'retrobox' ` is
62+ equivalent to `autocmd User LumenLight colorscheme retrobox`,
63+ also see | g:lumen_dark_colorscheme | .
64+
65+ g:lumen_dark_colorscheme *g:lumen_dark_colorscheme*
66+ This variable defines the colorscheme to change to (if any),
67+ when the system switches to dark mode. For a more generic
68+ callback, consult | User_LumenDark | .
69+ For example `let g:lumen_dark_colorscheme = 'retrobox' ` is
70+ equivalent to `autocmd User LumenDark colorscheme retrobox`,
71+ also see | g:lumen_light_colorscheme | .
72+
5773------------------------------------------------------------------------------
5874AUTOCOMMANDS *lumen-autocommands*
5975
You can’t perform that action at this time.
0 commit comments