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;
|
2024-06-08 18:10:16 +02:00
|
|
|
cmdHeight = 1;
|
2024-04-14 18:31:07 +02:00
|
|
|
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
|
|
|
|
|
|
|
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-06-11 18:35:38 +02:00
|
|
|
unicode.package = unicode-vim;
|
2024-07-16 12:35:47 +02:00
|
|
|
repolink = {
|
|
|
|
package = pkgs.stdenv.mkDerivation {
|
|
|
|
name = "repolink";
|
|
|
|
src = pkgs.fetchFromGitHub {
|
|
|
|
owner = "9seconds";
|
|
|
|
repo = "repolink.nvim";
|
|
|
|
rev = "55edfedbaef3e894d2ab5107ea7fadc64cb8258d";
|
|
|
|
hash = "sha256-ykCswLzq38tO0GE4IB0dT3g239qkKpoW+d27sCorR90=";
|
|
|
|
};
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
cp -r . $out
|
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
setup = /*lua*/''
|
|
|
|
require("repolink").setup({
|
|
|
|
use_full_commit_hash = true,
|
|
|
|
url_builders = {
|
|
|
|
["github"] = require("repolink").url_builder_for_github("https://github.com"),
|
|
|
|
["gitlab"] = require("repolink").url_builder_for_gitlab("https://gitlab.com"),
|
|
|
|
["codeberg"] = require("repolink").url_builder_for_gitea("https://codeberg.org"),
|
|
|
|
["jacekpoz"] = require("repolink").url_builder_for_gitea("https://git.jacekpoz.pl"),
|
|
|
|
["outfoxxed"] = require("repolink").url_builder_for_gitea("https://git.outfoxxed.me"),
|
|
|
|
},
|
|
|
|
custom_url_parser = function(remote_url)
|
|
|
|
local host, user, project = string.match(
|
|
|
|
remote_url,
|
|
|
|
"^([^:]+):([^/]+)/(.+)$"
|
|
|
|
)
|
|
|
|
if host then
|
|
|
|
return host, {
|
|
|
|
user = user,
|
|
|
|
project = project
|
|
|
|
}
|
|
|
|
end
|
|
|
|
end
|
|
|
|
})
|
|
|
|
'';
|
|
|
|
};
|
2024-04-14 18:31:07 +02:00
|
|
|
};
|
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-06-08 17:54:05 +02:00
|
|
|
filetree.neo-tree = {
|
|
|
|
enable = true;
|
|
|
|
};
|
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;
|
|
|
|
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;
|
2024-05-16 19:42:28 +02:00
|
|
|
|
2024-04-14 18:31:07 +02:00
|
|
|
bash.enable = true;
|
|
|
|
clang = {
|
|
|
|
enable = true;
|
|
|
|
cHeader = true;
|
|
|
|
};
|
2024-05-16 19:42:28 +02:00
|
|
|
css.enable = true;
|
|
|
|
html.enable = true;
|
2024-04-14 18:31:07 +02:00
|
|
|
java.enable = true;
|
|
|
|
markdown.enable = true;
|
|
|
|
nix.enable = true;
|
2024-05-16 19:42:28 +02:00
|
|
|
ocaml.enable = true;
|
2024-04-14 18:31:07 +02:00
|
|
|
rust = {
|
|
|
|
enable = true;
|
|
|
|
crates.enable = true;
|
2023-12-21 13:53:58 +01:00
|
|
|
};
|
2024-05-16 19:42:28 +02:00
|
|
|
ts.enable = true;
|
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-06-15 21:26:42 +02:00
|
|
|
surround = {
|
|
|
|
enable = true;
|
|
|
|
useVendoredKeybindings = true;
|
|
|
|
};
|
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
|
2024-06-08 18:10:27 +02:00
|
|
|
|
2024-06-23 19:54:44 +02:00
|
|
|
notes = {
|
|
|
|
todo-comments = {
|
|
|
|
enable = true;
|
|
|
|
mappings.telescope = "<leader>tt";
|
|
|
|
setupOpts.highlight.pattern = ".*<(KEYWORDS)\s*";
|
|
|
|
};
|
|
|
|
orgmode = {
|
|
|
|
enable = true;
|
|
|
|
setupOpts = {
|
|
|
|
org_agenda_files = [ "~/Notes/org" ];
|
|
|
|
org_default_notes_file = "~/Notes/org/refile.org";
|
|
|
|
};
|
|
|
|
treesitter.enable = true;
|
|
|
|
};
|
2024-06-08 18:10:27 +02:00
|
|
|
};
|
2024-04-14 18:31:07 +02:00
|
|
|
};
|
2023-11-25 17:12:09 +01:00
|
|
|
};
|
2023-09-08 16:10:15 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|