initial config
This commit is contained in:
131
modules/user/neovim.nix
Normal file
131
modules/user/neovim.nix
Normal file
@@ -0,0 +1,131 @@
|
||||
# ==========================================
|
||||
# NEOVIM CONFIGURATION (via Nixvim)
|
||||
# ==========================================
|
||||
# Gruvbox theme, LSP, Treesitter, Telescope, file tree.
|
||||
# ==========================================
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
programs.nixvim = {
|
||||
enable = true;
|
||||
|
||||
opts = {
|
||||
number = true;
|
||||
relativenumber = true;
|
||||
shiftwidth = 2;
|
||||
tabstop = 2;
|
||||
expandtab = true;
|
||||
smartindent = true;
|
||||
wrap = false;
|
||||
swapfile = false;
|
||||
backup = false;
|
||||
undofile = true;
|
||||
hlsearch = false;
|
||||
incsearch = true;
|
||||
termguicolors = true;
|
||||
scrolloff = 8;
|
||||
signcolumn = "yes";
|
||||
updatetime = 50;
|
||||
clipboard = "unnamedplus";
|
||||
};
|
||||
|
||||
globals = {
|
||||
mapleader = " ";
|
||||
maplocalleader = " ";
|
||||
};
|
||||
|
||||
# Gruvbox colorscheme — matches omarchy aesthetic
|
||||
colorschemes.gruvbox = {
|
||||
enable = true;
|
||||
settings = {
|
||||
contrast_dark = "hard";
|
||||
transparent_mode = true;
|
||||
};
|
||||
};
|
||||
|
||||
# Treesitter (syntax highlighting)
|
||||
plugins.treesitter = {
|
||||
enable = true;
|
||||
settings.highlight.enable = true;
|
||||
settings.indent.enable = true;
|
||||
};
|
||||
|
||||
# Telescope (fuzzy finder)
|
||||
plugins.telescope = {
|
||||
enable = true;
|
||||
keymaps = {
|
||||
"<leader>ff" = { action = "find_files"; options.desc = "Find files"; };
|
||||
"<leader>fg" = { action = "live_grep"; options.desc = "Live grep"; };
|
||||
"<leader>fb" = { action = "buffers"; options.desc = "Buffers"; };
|
||||
"<leader>fh" = { action = "help_tags"; options.desc = "Help tags"; };
|
||||
"<leader>fr" = { action = "oldfiles"; options.desc = "Recent files"; };
|
||||
};
|
||||
};
|
||||
|
||||
# Neo-tree (file tree)
|
||||
plugins.neo-tree = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
# LSP
|
||||
plugins.lsp = {
|
||||
enable = true;
|
||||
servers = {
|
||||
nil_ls.enable = true; # Nix
|
||||
pyright.enable = true; # Python
|
||||
ts_ls.enable = true; # TypeScript/JavaScript
|
||||
bashls.enable = true; # Bash
|
||||
jsonls.enable = true; # JSON
|
||||
yamlls.enable = true; # YAML
|
||||
html.enable = true; # HTML
|
||||
cssls.enable = true; # CSS
|
||||
};
|
||||
};
|
||||
|
||||
# Autocompletion
|
||||
plugins.cmp = {
|
||||
enable = true;
|
||||
autoEnableSources = true;
|
||||
settings = {
|
||||
sources = [
|
||||
{ name = "nvim_lsp"; }
|
||||
{ name = "path"; }
|
||||
{ name = "buffer"; }
|
||||
];
|
||||
mapping = {
|
||||
"<C-n>" = "cmp.mapping.select_next_item()";
|
||||
"<C-p>" = "cmp.mapping.select_prev_item()";
|
||||
"<C-y>" = "cmp.mapping.confirm({ select = true })";
|
||||
"<C-Space>" = "cmp.mapping.complete()";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# Status line
|
||||
plugins.lualine = {
|
||||
enable = true;
|
||||
settings.options.theme = "gruvbox";
|
||||
};
|
||||
|
||||
# Autopairs
|
||||
plugins.nvim-autopairs.enable = true;
|
||||
|
||||
# Git signs in the gutter
|
||||
plugins.gitsigns.enable = true;
|
||||
|
||||
# Which-key (show keybindings)
|
||||
plugins.which-key.enable = true;
|
||||
|
||||
# Keymaps
|
||||
keymaps = [
|
||||
{ key = "<leader>e"; action = "<cmd>Neotree toggle<CR>"; options.desc = "Toggle file tree"; }
|
||||
{ key = "<leader>w"; action = "<cmd>w<CR>"; options.desc = "Save"; }
|
||||
{ key = "<leader>q"; action = "<cmd>q<CR>"; options.desc = "Quit"; }
|
||||
# Window navigation
|
||||
{ key = "<C-h>"; action = "<C-w>h"; options.desc = "Move left"; }
|
||||
{ key = "<C-j>"; action = "<C-w>j"; options.desc = "Move down"; }
|
||||
{ key = "<C-k>"; action = "<C-w>k"; options.desc = "Move up"; }
|
||||
{ key = "<C-l>"; action = "<C-w>l"; options.desc = "Move right"; }
|
||||
];
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user