From ae5b060cfa05b27b7322ad2944b4eaa1d494fb86 Mon Sep 17 00:00:00 2001 From: Abhishek Keshri Date: Mon, 10 Jun 2024 18:11:20 +0530 Subject: [PATCH] feat: add commons with transparent bg --- themes/neovim/commons.lua | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 themes/neovim/commons.lua 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