From 4a96f5c4fd4b3305599233873ccd4c5c535769fa Mon Sep 17 00:00:00 2001 From: Simon Lasbrugnas Date: Mon, 24 Mar 2025 10:33:51 +0100 Subject: [PATCH] chore: update plugins for better transparent display --- lua/config/options.lua | 2 +- lua/custom/lualine.lua | 6 ++++-- lua/custom/plugins/colorscheme.lua | 2 ++ lua/custom/plugins/treesitter.lua | 17 +++++++++++++++++ 4 files changed, 24 insertions(+), 3 deletions(-) diff --git a/lua/config/options.lua b/lua/config/options.lua index 97f32e1..42237c3 100644 --- a/lua/config/options.lua +++ b/lua/config/options.lua @@ -12,7 +12,7 @@ opt.expandtab = false opt.smartindent = true -- Highlight cursor line -opt.cursorline = true +-- opt.cursorline = true -- Use line wrapping opt.wrap = true diff --git a/lua/custom/lualine.lua b/lua/custom/lualine.lua index 9859367..921559d 100644 --- a/lua/custom/lualine.lua +++ b/lua/custom/lualine.lua @@ -20,11 +20,11 @@ require("lualine").setup({ }, sections = { lualine_a = { "mode" }, - lualine_b = { {'branch', icon = {'', align='right'}} , "diff", "diagnostics" }, + lualine_b = { { 'branch', icon = { '', align = 'right' } }, "diff", "diagnostics" }, lualine_c = { { "filename", path = 1 } }, lualine_x = { "filetype" }, lualine_y = {}, - lualine_z = { "location" } + lualine_z = { { "location", color = { bg = 'none' } } }, }, inactive_sections = { lualine_a = {}, @@ -39,3 +39,5 @@ require("lualine").setup({ inactive_winbar = {}, extensions = {} }) + +vim.cmd("hi lualine_c_normal guibg=none") diff --git a/lua/custom/plugins/colorscheme.lua b/lua/custom/plugins/colorscheme.lua index 78065b1..39815d7 100644 --- a/lua/custom/plugins/colorscheme.lua +++ b/lua/custom/plugins/colorscheme.lua @@ -8,6 +8,8 @@ return { config = function() -- vim.g.zenbones_darken_comments = 45 vim.cmd.colorscheme('zenwritten') + -- Set transparent background and disable cursorline + vim.api.nvim_set_hl(0, "Normal", { bg = "NONE" }) end }, { diff --git a/lua/custom/plugins/treesitter.lua b/lua/custom/plugins/treesitter.lua index de69dec..6bdf4f2 100644 --- a/lua/custom/plugins/treesitter.lua +++ b/lua/custom/plugins/treesitter.lua @@ -52,6 +52,23 @@ return { desc = "Toggle Treesitter Context", }, }, + config = function(_, opts) + require("treesitter-context").setup(opts) + + -- Set transparent background for TreesitterContext highlight groups + vim.api.nvim_create_autocmd("ColorScheme", { + callback = function() + vim.cmd("hi TreesitterContext guibg=none") + vim.cmd("hi TreesitterContextLineNumber guibg=none") + vim.cmd("hi TreesitterContextBottom guibg=none") + end, + }) + + -- Apply immediately + vim.cmd("hi TreesitterContext guibg=none") + vim.cmd("hi TreesitterContextLineNumber guibg=none") + vim.cmd("hi TreesitterContextBottom guibg=none") + end, }, -- Automatically add closing tags for HTML and JSX