diff --git a/themes/neovim/commons.lua b/themes/neovim/commons.lua new file mode 100644 index 0000000..5ea8e17 --- /dev/null +++ b/themes/neovim/commons.lua @@ -0,0 +1,31 @@ +local commons = {} + +commons.set_transparent_bg = function() + -- transparent background + vim.api.nvim_set_hl(0, 'Normal', { bg = 'none' }) + vim.api.nvim_set_hl(0, 'NormalFloat', { bg = 'none' }) + vim.api.nvim_set_hl(0, 'FloatBorder', { bg = 'none' }) + vim.api.nvim_set_hl(0, 'Pmenu', { bg = 'none' }) + vim.api.nvim_set_hl(0, 'Terminal', { bg = 'none' }) + vim.api.nvim_set_hl(0, 'EndOfBuffer', { bg = 'none' }) + vim.api.nvim_set_hl(0, 'FoldColumn', { bg = 'none' }) + vim.api.nvim_set_hl(0, 'Folded', { bg = 'none' }) + vim.api.nvim_set_hl(0, 'SignColumn', { bg = 'none' }) + + -- transparent background for neotree + vim.api.nvim_set_hl(0, 'NeoTreeNormal', { bg = 'none' }) + vim.api.nvim_set_hl(0, 'NeoTreeNormalNC', { bg = 'none' }) + vim.api.nvim_set_hl(0, 'NeoTreeVertSplit', { bg = 'none' }) + vim.api.nvim_set_hl(0, 'NeoTreeWinSeparator', { bg = 'none' }) + vim.api.nvim_set_hl(0, 'NeoTreeEndOfBuffer', { bg = 'none' }) + + -- transparent background for nvim-tree + vim.api.nvim_set_hl(0, 'NvimTreeNormal', { bg = 'none' }) + vim.api.nvim_set_hl(0, 'NvimTreeVertSplit', { bg = 'none' }) + vim.api.nvim_set_hl(0, 'NvimTreeEndOfBuffer', { bg = 'none' }) + + -- hides `~` at the end of the buffer + vim.cmd([[set fillchars+=eob:\ ]]) +end + +return commons