{ config, lib, pkgs, ... }: { programs.nixneovim = { enable = true; defaultEditor = true; viAlias = true; vimAlias = true; extraLuaPreConfig = builtins.readFile ./neovim/pre.lua; extraConfigLua = builtins.readFile ./neovim/core.lua; colorscheme = "onedark"; colorschemes = { onedark.enable = true; }; plugins = { lsp = { enable = true; servers = { bashls.enable = true; gopls.enable = true; jsonls.enable = true; pyright.enable = true; rust-analyzer.enable = true; }; }; treesitter = { enable = true; indent = true; folding = true; incrementalSelection = { enable = true; }; }; mini = { enable = true; ai.enable = true; align.enable = true; animate.enable = true; comment.enable = true; jump.enable = true; surround.enable = true; }; fugitive = { enable = true; }; undotree = { enable = true; }; which-key = { enable = true; }; project-nvim = { enable = true; }; }; extraPlugins = ( with pkgs.vimPlugins; [ vim-ReplaceWithRegister ctrlp-vim vim-dispatch-neovim vim-bbye editorconfig-nvim vim-expand-region vim-signify vim-terraform leap-nvim ] ) ++ (with pkgs.vimExtraPlugins; [ nvim-ts-rainbow ]); mappings = { normal = { "u" = { action = "vim.cmd.UndotreeToggle"; }; "h" = { action = "function() vim.api.nvim_command('wincmd h') end"; }; "j" = { action = "function() vim.api.nvim_command('wincmd j') end"; }; "k" = { action = "function() vim.api.nvim_command('wincmd k') end"; }; "l" = { action = "function() vim.api.nvim_command('wincmd l') end"; }; "" = { action = "''"; }; "" = { action = "''"; }; "n" = { action = "function() vim.api.nvim_command('nohl') end"; }; }; visual = { "" = { action = "''"; }; "" = { action = "''"; }; }; }; }; }