Use different gruvbox colorscheme

main
Ensar Sarajčić 2024-01-19 15:48:13 +01:00
parent ecfe01d52d
commit cf93c050f7
3 changed files with 21 additions and 10 deletions

View File

@ -1,7 +1,11 @@
vim.o.termguicolors = true vim.o.termguicolors = true
vim.o.background = "dark" vim.o.background = "dark"
vim.g.gruvbox_material_foreground = "original"
vim.g.gruvbox_material_better_performance = 1 require("gruvbox").setup({
vim.g.gruvbox_material_enable_bold = 1 ---@diagnostic disable-next-line: missing-fields
vim.g.gruvbox_material_enable_italic = 1 italic = {
vim.cmd([[colorscheme gruvbox-material]]) strings = false,
},
})
vim.cmd.colorscheme("gruvbox")

View File

@ -30,7 +30,7 @@ return require("lazy").setup({
"mhinz/vim-grepper", -- Grepper command - improved grepping throughout project "mhinz/vim-grepper", -- Grepper command - improved grepping throughout project
"radenling/vim-dispatch-neovim", -- vim-dispatch for neovim - uses terminal "radenling/vim-dispatch-neovim", -- vim-dispatch for neovim - uses terminal
"wellle/targets.vim", -- Additional targets for inside and around motions "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-qf", -- Quickfix list upgrades
{ "romainl/vim-devdocs", cmd = "DD" }, -- Quick DevDocs.io search using :DD { "romainl/vim-devdocs", cmd = "DD" }, -- Quick DevDocs.io search using :DD
"gpanders/editorconfig.nvim", -- .editorconfig support "gpanders/editorconfig.nvim", -- .editorconfig support

View File

@ -33,15 +33,22 @@ local edit_modes = {
local function update_colors() local function update_colors()
local status_line_hl = vim.api.nvim_get_hl(0, { name = "StatusLine" }) 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 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 hl_based_on = vim.api.nvim_get_hl(0, { name = based_on })
local user_config = { while hl_based_on.link do
foreground = hl_based_on.fg, 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, background = bg,
bold = true, bold = true,
} })
vim.api.nvim_set_hl(0, user_hl_name, user_config) vim.api.nvim_set_hl(0, user_hl_name, user_config)
end end