Set initial colorscheme on debian hosts

This commit is contained in:
sonny 2024-10-11 22:02:29 +02:00
parent 4dba4f2bb0
commit 8bd8ce698c

View file

@ -1,19 +1,26 @@
-- {{ ansible_managed }} -- {{ ansible_managed }}
-- set the colorscheme whenever the background setting changes local background_callback = function()
vim.api.nvim_create_autocmd({'OptionSet'}, { if vim.o.background == 'dark' then
pattern = {'background'}, vim.cmd('colorscheme github_dark_dimmed')
callback = function() else
if vim.o.background == 'dark' then vim.cmd('colorscheme github_light')
vim.cmd('colorscheme github_dark_dimmed') end
else
vim.cmd('colorscheme github_light')
end
-- force a full redraw: -- force a full redraw:
vim.cmd('mode') vim.cmd('mode')
end end
})
-- set the colorscheme whenever the background setting changes
vim.api.nvim_create_autocmd(
{ 'OptionSet' },
{ pattern = { 'background' }, callback = background_callback }
)
{% if ansible_facts['os_family'] == 'Debian' %}
background_callback()
{% endif %}
{% if ansible_facts['os_family'] == 'Archlinux' %} {% if ansible_facts['os_family'] == 'Archlinux' %}
--[[ --[[