nix/nvim.nix
Yan Lin 9fcb2b8dce Restore gruvbox truecolor theme for iTerm2 compatibility
- Restore tmux truecolor gruvbox theme with terminal overrides for iTerm2
- Add gruvbox.setup() with hard contrast for much darker nvim background
- Configure lualine with gruvbox_dark theme to match colorscheme
- Background changed from #282828 to #1d2021 for enhanced contrast

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-26 00:36:08 +02:00

72 lines
1.9 KiB
Nix

{ pkgs, ... }:
{
programs.neovim = {
enable = true;
defaultEditor = true;
plugins = with pkgs.vimPlugins; [
nvim-tree-lua
nvim-treesitter.withAllGrammars
lualine-nvim
nvim-web-devicons
gruvbox-nvim
];
extraLuaConfig = ''
-- Basic settings
vim.opt.number = true
vim.opt.relativenumber = false
vim.opt.expandtab = true
vim.opt.shiftwidth = 2
vim.opt.tabstop = 2
vim.opt.smartindent = true
vim.opt.wrap = false
vim.opt.termguicolors = true
-- Enable filetype detection and syntax
vim.cmd('filetype on')
vim.cmd('filetype plugin on')
vim.cmd('filetype indent on')
vim.cmd('syntax enable')
-- Leader key
vim.g.mapleader = " "
-- Configure gruvbox with hard contrast for darker background
require("gruvbox").setup({
contrast = "hard", -- Makes background much darker (#1d2021 instead of #282828)
})
vim.opt.background = "dark"
vim.cmd('colorscheme gruvbox')
-- Nvim-tree setup
require("nvim-tree").setup({})
vim.keymap.set("n", "<leader>e", ":NvimTreeToggle<CR>", { desc = "Toggle file explorer" })
-- Treesitter setup
require('nvim-treesitter.configs').setup({
highlight = {
enable = true,
additional_vim_regex_highlighting = true,
},
indent = {
enable = true,
},
ensure_installed = {}, -- Managed by Nix
auto_install = false,
})
-- Lualine setup with gruvbox theme
require('lualine').setup({
options = {
theme = 'gruvbox_dark',
component_separators = { left = '|', right = '|'},
section_separators = { left = ' ', right = ' '},
},
})
-- Basic keymaps
vim.keymap.set("n", "<leader>w", ":w<CR>", { desc = "Save file" })
vim.keymap.set("n", "<leader>q", ":q<CR>", { desc = "Quit" })
'';
};
}