Skip to content

Commit

Permalink
INIT
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Burgin committed Sep 13, 2021
0 parents commit 377e60f
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
1 change: 1 addition & 0 deletions autoload/background_nvim.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lua require'background_nvim.lua'
25 changes: 25 additions & 0 deletions lua/background_nvim.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
function check_which_theme()
local hour = os.date("*t").hour
if (hour > 16) then
vim.opt.background = 'dark'
else
vim.opt.background = 'light'
end
end

local background_nvim = {}

local function background_nvim.setup(options)
vim.g.BackgroundNvimMS = options.ms

check_which_theme();

vim.cmd([[
func! ThemeChecker(timer)
lua check_which_theme()
endfunc
let timer = timer_start(g:BackgroundNvimMS, 'ThemeChecker', {'repeat': -1})
]])
end

return background_nvim

0 comments on commit 377e60f

Please sign in to comment.