From ae5b060cfa05b27b7322ad2944b4eaa1d494fb86 Mon Sep 17 00:00:00 2001 From: Abhishek Keshri Date: Mon, 10 Jun 2024 18:11:20 +0530 Subject: [PATCH 1/3] 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 From e8548954acba4bd58bbaadb7cfbf5c34e65e3e64 Mon Sep 17 00:00:00 2001 From: Abhishek Keshri Date: Mon, 10 Jun 2024 18:11:36 +0530 Subject: [PATCH 2/3] feat: copy commons file during installation --- install/app-neovim.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/install/app-neovim.sh b/install/app-neovim.sh index c25f27a..ce59dd3 100644 --- a/install/app-neovim.sh +++ b/install/app-neovim.sh @@ -4,5 +4,6 @@ sudo apt install -y neovim if [ ! -d "$HOME/.config/nvim" ]; then git clone https://github.com/LazyVim/starter ~/.config/nvim + cp ~/.local/share/omakub/themes/neovim/commons.lua ~/.config/nvim/lua/plugins/ cp ~/.local/share/omakub/themes/neovim/tokyo-night.lua ~/.config/nvim/lua/plugins/theme.lua fi From 7d300ad6f6b06f9739bb99491f96844cbf059e52 Mon Sep 17 00:00:00 2001 From: Abhishek Keshri Date: Mon, 10 Jun 2024 18:13:39 +0530 Subject: [PATCH 3/3] feat: set transparent bg for all themes --- themes/neovim/catppuccin.lua | 1 + themes/neovim/everforest.lua | 1 + themes/neovim/gruvbox.lua | 1 + themes/neovim/kanagawa.lua | 1 + themes/neovim/nord.lua | 1 + themes/neovim/rose-pine.lua | 1 + themes/neovim/tokyo-night.lua | 1 + 7 files changed, 7 insertions(+) diff --git a/themes/neovim/catppuccin.lua b/themes/neovim/catppuccin.lua index a1cd989..750c2ad 100644 --- a/themes/neovim/catppuccin.lua +++ b/themes/neovim/catppuccin.lua @@ -4,6 +4,7 @@ return { opts = { transparent_background = true, }, + config = require('plugins.commons').set_transparent_bg() }, { "LazyVim/LazyVim", diff --git a/themes/neovim/everforest.lua b/themes/neovim/everforest.lua index 55c78f1..b01157d 100644 --- a/themes/neovim/everforest.lua +++ b/themes/neovim/everforest.lua @@ -6,5 +6,6 @@ return { colorscheme = "everforest", background = "soft", }, + config = require('plugins.commons').set_transparent_bg() }, } diff --git a/themes/neovim/gruvbox.lua b/themes/neovim/gruvbox.lua index edaf0d5..382e0ec 100644 --- a/themes/neovim/gruvbox.lua +++ b/themes/neovim/gruvbox.lua @@ -5,5 +5,6 @@ return { opts = { colorscheme = "gruvbox", }, + config = require('plugins.commons').set_transparent_bg() }, } diff --git a/themes/neovim/kanagawa.lua b/themes/neovim/kanagawa.lua index 2ad2155..c0a3ace 100644 --- a/themes/neovim/kanagawa.lua +++ b/themes/neovim/kanagawa.lua @@ -5,5 +5,6 @@ return { opts = { colorscheme = "kanagawa", }, + config = require('plugins.commons').set_transparent_bg() }, } diff --git a/themes/neovim/nord.lua b/themes/neovim/nord.lua index fc2254e..698a5fe 100644 --- a/themes/neovim/nord.lua +++ b/themes/neovim/nord.lua @@ -5,5 +5,6 @@ return { opts = { colorscheme = "nord", }, + config = require('plugins.commons').set_transparent_bg() }, } diff --git a/themes/neovim/rose-pine.lua b/themes/neovim/rose-pine.lua index 591e8c7..f637267 100644 --- a/themes/neovim/rose-pine.lua +++ b/themes/neovim/rose-pine.lua @@ -5,5 +5,6 @@ return { opts = { colorscheme = "rose-pine-dawn", }, + config = require('plugins.commons').set_transparent_bg() }, } diff --git a/themes/neovim/tokyo-night.lua b/themes/neovim/tokyo-night.lua index d8ea440..f721b32 100644 --- a/themes/neovim/tokyo-night.lua +++ b/themes/neovim/tokyo-night.lua @@ -13,6 +13,7 @@ return { sidebars = "transparent", floats = "transparent", }, + config = require('plugins.commons').set_transparent_bg() }, }, }