2023-09-08 16:10:15 +02:00
|
|
|
{
|
2023-11-30 15:38:08 +01:00
|
|
|
config,
|
|
|
|
inputs,
|
|
|
|
lib,
|
|
|
|
pkgs,
|
|
|
|
...
|
2024-05-05 12:38:40 +02:00
|
|
|
}: let
|
2023-11-30 15:38:08 +01:00
|
|
|
cfg = config.myOptions.programs.neovim;
|
2024-04-14 18:49:29 +02:00
|
|
|
inherit (config.myOptions.other.system) username;
|
2024-05-05 12:38:40 +02:00
|
|
|
|
|
|
|
inherit (lib) mkEnableOption mkIf;
|
2023-10-13 21:04:24 +02:00
|
|
|
in {
|
2024-04-05 22:59:32 +02:00
|
|
|
options.myOptions.programs.neovim.enable = mkEnableOption "neovim";
|
2023-11-25 17:12:09 +01:00
|
|
|
|
2023-11-30 15:38:08 +01:00
|
|
|
config = mkIf cfg.enable {
|
2024-04-14 18:31:07 +02:00
|
|
|
environment.sessionVariables = {
|
|
|
|
EDITOR = "nvim";
|
|
|
|
};
|
2024-02-29 01:16:53 +01:00
|
|
|
|
2024-02-29 00:29:56 +01:00
|
|
|
home-manager.users.${username} = {
|
2024-04-26 22:18:40 +02:00
|
|
|
imports = [ inputs.nvf.homeManagerModules.default ];
|
2023-11-25 17:12:09 +01:00
|
|
|
|
2024-05-14 12:40:59 +02:00
|
|
|
programs.nvf = {
|
2023-11-30 15:38:08 +01:00
|
|
|
enable = true;
|
2024-04-14 18:31:07 +02:00
|
|
|
settings.vim = {
|
|
|
|
package = inputs.neovim-nightly-overlay.packages.${pkgs.system}.neovim;
|
|
|
|
viAlias = false;
|
|
|
|
vimAlias = false;
|
|
|
|
enableLuaLoader = true;
|
|
|
|
scrollOffset = 7;
|
|
|
|
preventJunkFiles = true;
|
|
|
|
tabWidth = 4;
|
|
|
|
autoIndent = false;
|
|
|
|
cmdHeight = 1;
|
|
|
|
useSystemClipboard = false;
|
2023-11-25 17:12:09 +01:00
|
|
|
|
2024-04-14 18:31:07 +02:00
|
|
|
theme = {
|
2023-11-30 15:38:08 +01:00
|
|
|
enable = true;
|
2024-04-14 18:31:07 +02:00
|
|
|
name = "catppuccin";
|
|
|
|
style = "mocha";
|
|
|
|
transparent = true;
|
2023-11-30 15:38:08 +01:00
|
|
|
};
|
2024-04-14 18:31:07 +02:00
|
|
|
|
|
|
|
maps = {
|
|
|
|
normal = {
|
|
|
|
"<leader>v" = {
|
2024-04-18 21:52:41 +02:00
|
|
|
action = "<CMD>Neotree toggle<CR>";
|
2024-04-14 18:31:07 +02:00
|
|
|
silent = true;
|
|
|
|
};
|
|
|
|
"<leader>m" = {
|
|
|
|
action = "<CMD>MarkdownPreviewToggle<CR>";
|
|
|
|
silent = true;
|
|
|
|
};
|
2024-03-15 21:24:00 +01:00
|
|
|
};
|
2024-04-28 18:40:05 +02:00
|
|
|
terminal = {
|
|
|
|
# get out of terminal mode in toggleterm
|
|
|
|
"<ESC>" = {
|
|
|
|
action = "<C-\\><C-n>";
|
|
|
|
silent = true;
|
|
|
|
};
|
|
|
|
};
|
2023-11-30 15:38:08 +01:00
|
|
|
};
|
2024-04-14 18:31:07 +02:00
|
|
|
|
2024-04-18 21:52:41 +02:00
|
|
|
filetree.neo-tree = {
|
2023-11-30 15:38:08 +01:00
|
|
|
enable = true;
|
|
|
|
};
|
2024-04-14 18:31:07 +02:00
|
|
|
|
|
|
|
statusline.lualine = {
|
2023-11-30 15:38:08 +01:00
|
|
|
enable = true;
|
2024-04-14 18:31:07 +02:00
|
|
|
theme = "catppuccin";
|
2023-11-30 15:38:08 +01:00
|
|
|
};
|
2024-02-01 13:44:28 +01:00
|
|
|
|
2024-04-14 18:31:07 +02:00
|
|
|
extraPlugins = with pkgs.vimPlugins; {
|
|
|
|
zen-mode.package = zen-mode-nvim;
|
|
|
|
};
|
2024-02-01 13:44:28 +01:00
|
|
|
|
2024-04-14 18:31:07 +02:00
|
|
|
treesitter = {
|
|
|
|
enable = true;
|
|
|
|
fold = true;
|
|
|
|
context.enable = true;
|
|
|
|
};
|
2024-02-01 13:44:28 +01:00
|
|
|
|
2024-04-15 11:08:03 +02:00
|
|
|
autocomplete = {
|
|
|
|
enable = true;
|
|
|
|
alwaysComplete = false;
|
|
|
|
};
|
2024-02-01 13:44:28 +01:00
|
|
|
|
2024-04-14 18:31:07 +02:00
|
|
|
# TODO neo-tree
|
2024-02-01 13:44:28 +01:00
|
|
|
|
2024-04-14 18:31:07 +02:00
|
|
|
terminal.toggleterm = {
|
2023-11-30 15:38:08 +01:00
|
|
|
enable = true;
|
2024-05-08 21:33:50 +02:00
|
|
|
setupOpts.direction = "tab";
|
2024-04-28 18:37:12 +02:00
|
|
|
mappings.open = "<C-\\>";
|
2024-04-14 18:31:07 +02:00
|
|
|
# TODO shading_factor
|
|
|
|
# TODO shade_terminals
|
|
|
|
# TODO size
|
2023-11-30 15:38:08 +01:00
|
|
|
};
|
2024-04-14 18:31:07 +02:00
|
|
|
|
|
|
|
git = {
|
2023-11-30 15:38:08 +01:00
|
|
|
enable = true;
|
2024-04-14 18:31:07 +02:00
|
|
|
gitsigns = {
|
|
|
|
enable = true;
|
|
|
|
# TODO enable / disable all the settings
|
2023-11-30 15:38:08 +01:00
|
|
|
};
|
|
|
|
};
|
2024-04-14 18:31:07 +02:00
|
|
|
|
|
|
|
lsp = {
|
2023-11-30 15:38:08 +01:00
|
|
|
enable = true;
|
2024-04-14 18:31:07 +02:00
|
|
|
lspSignature.enable = true;
|
|
|
|
lspconfig.enable = true;
|
|
|
|
lsplines.enable = true;
|
|
|
|
mappings = {
|
|
|
|
addWorkspaceFolder = "<leader>wa";
|
|
|
|
codeAction = "<leader>a";
|
|
|
|
format = "<C-f>";
|
|
|
|
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>";
|
2023-11-30 15:38:08 +01:00
|
|
|
};
|
|
|
|
};
|
2024-04-14 18:31:07 +02:00
|
|
|
|
|
|
|
languages = {
|
|
|
|
enableDAP = true;
|
|
|
|
enableExtraDiagnostics = true;
|
|
|
|
enableFormat = true;
|
|
|
|
enableLSP = true;
|
|
|
|
enableTreesitter = true;
|
|
|
|
bash.enable = true;
|
|
|
|
clang = {
|
|
|
|
enable = true;
|
|
|
|
cHeader = true;
|
|
|
|
};
|
|
|
|
java.enable = true;
|
|
|
|
markdown.enable = true;
|
|
|
|
nix.enable = true;
|
|
|
|
rust = {
|
|
|
|
enable = true;
|
|
|
|
crates.enable = true;
|
2023-12-21 13:53:58 +01:00
|
|
|
};
|
2023-11-30 15:38:08 +01:00
|
|
|
};
|
2024-04-14 18:31:07 +02:00
|
|
|
|
|
|
|
utility = {
|
|
|
|
motion.leap.enable = true;
|
|
|
|
preview.markdownPreview.enable = true;
|
|
|
|
# TODO settings.theme = "dark";
|
2024-02-14 13:21:18 +01:00
|
|
|
};
|
2024-04-14 18:31:07 +02:00
|
|
|
visuals.fidget-nvim.enable = true;
|
|
|
|
|
|
|
|
# TODO laytan/cloak.nvim
|
2023-11-30 15:38:08 +01:00
|
|
|
|
2024-04-14 18:31:07 +02:00
|
|
|
telescope.enable = true;
|
|
|
|
|
|
|
|
comments.comment-nvim.enable = true;
|
|
|
|
|
|
|
|
# TODO learn and add harpoon
|
|
|
|
};
|
2023-11-25 17:12:09 +01:00
|
|
|
};
|
2023-09-08 16:10:15 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|