mirror of
https://github.com/harivansh-afk/nvim.git
synced 2026-04-18 06:04:08 +00:00
fix color for commit
This commit is contained in:
parent
675652a4b7
commit
b78c048447
1 changed files with 5 additions and 32 deletions
|
|
@ -30,38 +30,11 @@ return {
|
||||||
priority = 1000,
|
priority = 1000,
|
||||||
lazy = false,
|
lazy = false,
|
||||||
config = function()
|
config = function()
|
||||||
-- Auto-detect light/dark mode
|
-- Always use Gruvbox dark
|
||||||
local function set_theme()
|
vim.o.background = "dark"
|
||||||
-- Check if running in VSCode
|
vim.cmd.colorscheme("gruvbox")
|
||||||
if vim.env.VSCODE or vim.env.TERM_PROGRAM == "vscode" then
|
|
||||||
vim.o.termguicolors = true
|
|
||||||
vim.o.background = "light"
|
|
||||||
require('solarized').setup({})
|
|
||||||
vim.cmd.colorscheme("solarized")
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Check COLORFGBG for other terminals
|
-- Add command to manually toggle if needed
|
||||||
if os.getenv("COLORFGBG") then
|
|
||||||
local colors = vim.split(os.getenv("COLORFGBG"), ";")
|
|
||||||
if colors[2] and tonumber(colors[2]) > 7 then
|
|
||||||
vim.o.termguicolors = true
|
|
||||||
vim.o.background = "light"
|
|
||||||
require('solarized').setup({})
|
|
||||||
vim.cmd.colorscheme("solarized")
|
|
||||||
return
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Default to dark with Gruvbox
|
|
||||||
vim.o.background = "dark"
|
|
||||||
vim.cmd.colorscheme("gruvbox")
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Set theme on startup
|
|
||||||
set_theme()
|
|
||||||
|
|
||||||
-- Add command to manually toggle
|
|
||||||
vim.api.nvim_create_user_command("ToggleTheme", function()
|
vim.api.nvim_create_user_command("ToggleTheme", function()
|
||||||
if vim.g.colors_name == "gruvbox" then
|
if vim.g.colors_name == "gruvbox" then
|
||||||
vim.o.termguicolors = true
|
vim.o.termguicolors = true
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue