From cf93c050f75d57ca924c86c2bddb783ef61a45cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ensar=20Saraj=C4=8Di=C4=87?= Date: Fri, 19 Jan 2024 15:48:13 +0100 Subject: [PATCH] Use different gruvbox colorscheme --- symlinks/config/nvim/lua/esensar/init/colors.lua | 14 +++++++++----- symlinks/config/nvim/lua/esensar/init/plugins.lua | 2 +- .../config/nvim/lua/esensar/ui/statusline.lua | 15 +++++++++++---- 3 files changed, 21 insertions(+), 10 deletions(-) diff --git a/symlinks/config/nvim/lua/esensar/init/colors.lua b/symlinks/config/nvim/lua/esensar/init/colors.lua index 7b38439..5f9be2f 100644 --- a/symlinks/config/nvim/lua/esensar/init/colors.lua +++ b/symlinks/config/nvim/lua/esensar/init/colors.lua @@ -1,7 +1,11 @@ vim.o.termguicolors = true vim.o.background = "dark" -vim.g.gruvbox_material_foreground = "original" -vim.g.gruvbox_material_better_performance = 1 -vim.g.gruvbox_material_enable_bold = 1 -vim.g.gruvbox_material_enable_italic = 1 -vim.cmd([[colorscheme gruvbox-material]]) + +require("gruvbox").setup({ + ---@diagnostic disable-next-line: missing-fields + italic = { + strings = false, + }, +}) + +vim.cmd.colorscheme("gruvbox") diff --git a/symlinks/config/nvim/lua/esensar/init/plugins.lua b/symlinks/config/nvim/lua/esensar/init/plugins.lua index 8e6d80a..8a40a38 100644 --- a/symlinks/config/nvim/lua/esensar/init/plugins.lua +++ b/symlinks/config/nvim/lua/esensar/init/plugins.lua @@ -30,7 +30,7 @@ return require("lazy").setup({ "mhinz/vim-grepper", -- Grepper command - improved grepping throughout project "radenling/vim-dispatch-neovim", -- vim-dispatch for neovim - uses terminal "wellle/targets.vim", -- Additional targets for inside and around motions - "sainnhe/gruvbox-material", -- Gruvbox + "ellisonleao/gruvbox.nvim", -- colorscheme "romainl/vim-qf", -- Quickfix list upgrades { "romainl/vim-devdocs", cmd = "DD" }, -- Quick DevDocs.io search using :DD "gpanders/editorconfig.nvim", -- .editorconfig support diff --git a/symlinks/config/nvim/lua/esensar/ui/statusline.lua b/symlinks/config/nvim/lua/esensar/ui/statusline.lua index 06c69b3..52a2279 100644 --- a/symlinks/config/nvim/lua/esensar/ui/statusline.lua +++ b/symlinks/config/nvim/lua/esensar/ui/statusline.lua @@ -33,15 +33,22 @@ local edit_modes = { local function update_colors() local status_line_hl = vim.api.nvim_get_hl(0, { name = "StatusLine" }) - local bg = status_line_hl.bg + local bg + if status_line_hl.reverse then + bg = status_line_hl.fg + else + bg = status_line_hl.bg + end local function set_user_highlight_based_on(user_hl_name, based_on) local hl_based_on = vim.api.nvim_get_hl(0, { name = based_on }) - local user_config = { - foreground = hl_based_on.fg, + while hl_based_on.link do + hl_based_on = vim.api.nvim_get_hl(0, { name = hl_based_on.link }) + end + local user_config = vim.tbl_extend("force", hl_based_on, { background = bg, bold = true, - } + }) vim.api.nvim_set_hl(0, user_hl_name, user_config) end