From 94b8414e1bc3a4898703824e9d86d6e0025da547 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Thu, 2 Feb 2023 00:00:07 +0300 Subject: [PATCH] feat: add minimap-vim to plugins --- modules/filetree/nvimtreelua.nix | 46 ++++++++++++++++++++++++++++++-- 1 file changed, 44 insertions(+), 2 deletions(-) diff --git a/modules/filetree/nvimtreelua.nix b/modules/filetree/nvimtreelua.nix index cb6f9bf..17ff6ac 100644 --- a/modules/filetree/nvimtreelua.nix +++ b/modules/filetree/nvimtreelua.nix @@ -22,13 +22,19 @@ in { }; treeWidth = mkOption { - default = 25; + default = 30; description = "Width of the tree in charecters"; type = types.int; }; + adaptiveSize = mkOption { + default = true; + description = "Whether to enable adaptiveSize"; + type = types.bool; + }; + hideFiles = mkOption { - default = [".git" "node_modules" ".cache"]; + default = [".git" "node_modules" ".cache" ".idea"]; description = "Files to hide in the file view by default."; type = with types; listOf str; }; @@ -39,6 +45,10 @@ in { type = types.bool; }; + highlightGit = { + mkEnableOption = "Enable git highlights"; + }; + openOnSetup = mkOption { default = true; description = "Open when vim is started on a directory"; @@ -105,6 +115,12 @@ in { type = types.bool; }; + hijackCursor = mkOption { + default = true; + description = "Keeps the cursor on the first letter of the filename when moving in the tree"; + type = types.bool; + }; + trailingSlash = mkOption { default = true; description = "Add a trailing slash to all folders"; @@ -128,6 +144,25 @@ in { description = "The command used to open a file with the associated default program"; type = types.str; }; + + syncRootWithCwd = mkOption { + default = true; + description = "Changes the tree root directory on `DirChanged` and refreshes the tree"; + type = types.bool; + }; + + updateFocusedFile = { + mkEnableOption = "Enable updateFocusedFile"; + update_cwd = mkOption { + default = false; + description = ""; + type = types.bool; + }; + }; + + fileSystemWatchers = { + mkEnableOption = "Enable fileSystemWatchers"; + }; }; config = mkIf cfg.enable { @@ -144,6 +179,7 @@ in { require'nvim-tree'.setup({ disable_netrw = ${boolToString cfg.disableNetRW}, hijack_netrw = ${boolToString cfg.hijackNetRW}, + hijack_cursor = ${boolToString cfg.hijackCursor}, open_on_tab = ${boolToString cfg.openTreeOnNewTab}, open_on_setup = ${boolToString cfg.openOnSetup}, open_on_setup_file = ${boolToString cfg.openOnSetup}, @@ -154,10 +190,13 @@ in { enable = ${boolToString cfg.lspDiagnostics}, }, view = { + adaptive_size = ${boolToString cfg.adaptiveSize}, width = ${toString cfg.treeWidth}, side = ${"'" + cfg.treeSide + "'"}, }, renderer = { + highlight_git = ${boolToString cfg.highlightGit}, + indent_markers = { enable = ${boolToString cfg.indentMarkers}, }, @@ -180,6 +219,9 @@ in { ${builtins.concatStringsSep "\n" (builtins.map (s: "\"" + s + "\",") cfg.hideFiles)} }, }, + filesystem_watchers = { + enable = ${boolToString cfg.fileSystemWatchers}, + } }) ''; };