setup: add ui config with transparent bg

This commit also setup highlight for EOF-char & Window-Separator to
match the highlight on Cursor-Line-Number. And sets auto-command
to reset colors after changing the colorscheme.
This commit is contained in:
Abdulrahman Sheikho 2026-03-11 00:33:15 +03:00
parent 7a52a46ad4
commit 721ef79eda
3 changed files with 20 additions and 0 deletions

View File

@ -11,3 +11,12 @@ vim.api.nvim_create_autocmd('TextYankPost', {
vim.hl.on_yank() vim.hl.on_yank()
end, end,
}) })
vim.api.nvim_create_autocmd('ColorScheme', {
desc = 'Reset colors for some elemnts after changeing the colorscheme.',
group = vim.api.nvim_create_augroup('ElementsColorReset', { clear = true }),
callback = function()
vim.api.nvim_set_hl(0, 'WinSeparator', vim.api.nvim_get_hl(0, { name = 'CursorLineNr' }))
vim.api.nvim_set_hl(0, 'EndOfBuffer', vim.api.nvim_get_hl(0, { name = 'CursorLineNr' }))
end,
})

View File

@ -4,3 +4,4 @@ require 'core.keymaps'
require 'core.diagnostics' require 'core.diagnostics'
require 'core.autocommands' require 'core.autocommands'
require 'core.lazy-nvim' require 'core.lazy-nvim'
require 'core.ui'

10
lua/core/ui.lua Normal file
View File

@ -0,0 +1,10 @@
-- [[ UI Configs ]]
-- set transparency
vim.api.nvim_set_hl(0, 'Normal', { bg = 'none', ctermbg = 'none' })
vim.api.nvim_set_hl(0, 'NonText', { bg = 'none', ctermbg = 'none' })
vim.api.nvim_set_hl(0, 'SignColumn', { bg = 'none', ctermbg = 'none' })
vim.api.nvim_set_hl(0, 'FoldColumn', { bg = 'none', ctermbg = 'none' })
-- set WinSeparator & EndOfBuffer to match the highlight on cursor-line-number
vim.api.nvim_set_hl(0, 'WinSeparator', vim.api.nvim_get_hl(0, { name = 'CursorLineNr' }))
vim.api.nvim_set_hl(0, 'EndOfBuffer', vim.api.nvim_get_hl(0, { name = 'CursorLineNr' }))