2024-09-24 13:09:24 +00:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
inputs,
|
|
|
|
lib,
|
|
|
|
pkgs,
|
|
|
|
username,
|
|
|
|
...
|
2024-09-24 21:47:40 +00:00
|
|
|
}: let
|
2024-09-24 13:09:24 +00:00
|
|
|
cfg = config.modules.neovim;
|
2024-09-24 21:47:40 +00:00
|
|
|
in {
|
2024-09-24 13:09:24 +00:00
|
|
|
options.modules.neovim.enable = lib.mkEnableOption "neovim";
|
|
|
|
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
|
|
environment.sessionVariables = {
|
|
|
|
EDITOR = "nvim";
|
|
|
|
};
|
|
|
|
|
|
|
|
home-manager.users.${username} = {
|
2024-09-24 21:47:40 +00:00
|
|
|
imports = [inputs.nvf.homeManagerModules.default];
|
2024-09-24 13:09:24 +00:00
|
|
|
|
|
|
|
programs.nvf = {
|
|
|
|
enable = true;
|
|
|
|
settings.vim = {
|
|
|
|
viAlias = true;
|
|
|
|
vimAlias = true;
|
|
|
|
enableLuaLoader = true;
|
|
|
|
preventJunkFiles = true;
|
|
|
|
tabWidth = 4;
|
|
|
|
autoIndent = false;
|
|
|
|
useSystemClipboard = true;
|
|
|
|
|
|
|
|
luaConfigPost = lib.concatStrings [
|
|
|
|
''
|
|
|
|
vim.opt.formatoptions:remove('c')
|
|
|
|
vim.opt.formatoptions:remove('r')
|
|
|
|
vim.opt.formatoptions:remove('o')
|
|
|
|
''
|
|
|
|
];
|
|
|
|
|
|
|
|
maps = {
|
|
|
|
normal = {
|
2024-09-24 21:47:40 +00:00
|
|
|
"<leader>m" = {
|
|
|
|
silent = true;
|
|
|
|
action = "<cmd>make<CR>";
|
|
|
|
}; # Same as nnoremap <leader>m <silent> <cmd>make<CR>
|
2024-09-24 13:09:24 +00:00
|
|
|
"<leader>t" = {
|
|
|
|
silent = true;
|
2024-09-24 21:47:40 +00:00
|
|
|
action = "<cmd>Neotree toggle<CR>";
|
2024-09-24 13:09:24 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2024-09-24 21:47:40 +00:00
|
|
|
theme = {
|
|
|
|
enable = true;
|
|
|
|
name = "catppuccin";
|
|
|
|
style = "frappe";
|
|
|
|
};
|
|
|
|
|
|
|
|
visuals = {
|
|
|
|
enable = true;
|
|
|
|
nvimWebDevicons.enable = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
ui = {
|
|
|
|
noice.enable = true;
|
|
|
|
};
|
2024-09-24 22:01:27 +00:00
|
|
|
notify.nvim-notify.enable = true;
|
2024-09-24 21:47:40 +00:00
|
|
|
|
2024-09-24 13:09:24 +00:00
|
|
|
statusline.lualine = {
|
|
|
|
enable = true;
|
|
|
|
theme = "catppuccin";
|
|
|
|
};
|
|
|
|
|
2024-09-24 21:47:40 +00:00
|
|
|
git.enable = true;
|
|
|
|
|
2024-09-24 13:09:24 +00:00
|
|
|
lsp = {
|
|
|
|
enable = true;
|
|
|
|
lspSignature.enable = true;
|
|
|
|
lspconfig.enable = true;
|
|
|
|
formatOnSave = true;
|
|
|
|
mappings = {
|
|
|
|
addWorkspaceFolder = "<leader>wa";
|
|
|
|
codeAction = "<leader>a";
|
|
|
|
goToDeclaration = "gD";
|
|
|
|
goToDefinition = "gd";
|
|
|
|
hover = "K";
|
|
|
|
listImplementations = "gi";
|
|
|
|
listReferences = "gr";
|
|
|
|
listWorkspaceFolders = "<leader>wl";
|
|
|
|
nextDiagnostic = "<leader>k";
|
|
|
|
previousDiagnostic = "<leader>j";
|
|
|
|
openDiagnosticFloat = "<leader>e";
|
|
|
|
removeWorkspaceFolder = "<leader>wr";
|
|
|
|
renameSymbol = "<leader>r";
|
|
|
|
signatureHelp = "<C-k>";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
autocomplete = {
|
|
|
|
enable = true;
|
|
|
|
alwaysComplete = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
autopairs.enable = true;
|
|
|
|
languages = {
|
|
|
|
enableExtraDiagnostics = true;
|
|
|
|
enableFormat = true;
|
|
|
|
enableLSP = true;
|
|
|
|
enableTreesitter = true;
|
|
|
|
|
|
|
|
nix.enable = true;
|
|
|
|
clang.enable = true;
|
|
|
|
python.enable = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
treesitter = {
|
|
|
|
enable = true;
|
|
|
|
fold = true;
|
|
|
|
context.enable = true;
|
|
|
|
grammars = [
|
|
|
|
pkgs.vimPlugins.nvim-treesitter.builtGrammars.nix
|
|
|
|
pkgs.vimPlugins.nvim-treesitter.builtGrammars.c
|
|
|
|
pkgs.vimPlugins.nvim-treesitter.builtGrammars.python
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
binds.whichKey.enable = true;
|
2024-09-24 21:47:40 +00:00
|
|
|
filetree.neo-tree.enable = true;
|
2024-09-24 13:09:24 +00:00
|
|
|
|
|
|
|
telescope.enable = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|