diff --git a/plugins/by-name/project-nvim/default.nix b/plugins/by-name/project-nvim/default.nix index f8b82ece..56e0446c 100644 --- a/plugins/by-name/project-nvim/default.nix +++ b/plugins/by-name/project-nvim/default.nix @@ -3,9 +3,6 @@ config, ... }: -let - inherit (lib.nixvim) defaultNullOpts; -in lib.nixvim.plugins.mkNeovimPlugin { name = "project-nvim"; moduleName = "project"; @@ -13,72 +10,14 @@ lib.nixvim.plugins.mkNeovimPlugin { maintainers = [ lib.maintainers.khaneliman ]; - settingsOptions = { - manual_mode = defaultNullOpts.mkBool false '' - Manual mode doesn't automatically change your root directory, so you have the option to - manually do so using `:ProjectRoot` command. - ''; - - detection_methods = - defaultNullOpts.mkListOf lib.types.str - [ - "lsp" - "pattern" - ] - '' - Methods of detecting the root directory. - **"lsp"** uses the native neovim lsp, while **"pattern"** uses vim-rooter like glob pattern - matching. - Here order matters: if one is not detected, the other is used as fallback. - You can also delete or rearangne the detection methods. - ''; - - patterns = - defaultNullOpts.mkListOf lib.types.str - [ - ".git" - "_darcs" - ".hg" - ".bzr" - ".svn" - "Makefile" - "package.json" - ] - '' - All the patterns used to detect root dir, when **"pattern"** is in `detectionMethods`. - ''; - - ignore_lsp = defaultNullOpts.mkListOf lib.types.str [ ] "Table of lsp clients to ignore by name."; - - exclude_dirs = defaultNullOpts.mkListOf lib.types.str [ - ] "Don't calculate root dir on specific directories."; - - show_hidden = defaultNullOpts.mkBool false "Show hidden files in telescope."; - - silent_chdir = defaultNullOpts.mkBool true '' - When set to false, you will get a message when `project.nvim` changes your directory. - ''; - - scope_chdir = - defaultNullOpts.mkEnumFirstDefault - [ - "global" - "tab" - "win" - ] - '' - What scope to change the directory. - ''; - - data_path = defaultNullOpts.mkStr (lib.nixvim.literalLua "vim.fn.stdpath('data')") "Path where project.nvim will store the project history for use in telescope."; - }; - settingsExample = { - detection_methods = [ "lsp" ]; + lsp = { + enabled = true; + ignore = [ "tsserver" ]; + }; patterns = [ ".git" ]; - ignore_lsp = [ "tsserver" ]; - excludeDirs = [ "/home/user/secret-directory" ]; - showHidden = true; + exclude_dirs = [ "/home/user/secret-directory" ]; + show_hidden = true; silent_chdir = false; }; diff --git a/tests/test-sources/plugins/by-name/project-nvim/default.nix b/tests/test-sources/plugins/by-name/project-nvim/default.nix index 4d1d75bf..6402cf4a 100644 --- a/tests/test-sources/plugins/by-name/project-nvim/default.nix +++ b/tests/test-sources/plugins/by-name/project-nvim/default.nix @@ -31,10 +31,10 @@ enable = true; settings = { manual_mode = false; - detection_methods = [ - "lsp" - "pattern" - ]; + lsp = { + enabled = true; + ignore.__empty = { }; + }; patterns = [ ".git" "_darcs" @@ -44,7 +44,6 @@ "Makefile" "package.json" ]; - ignore_lsp.__empty = { }; exclude_dirs.__empty = { }; show_hidden = false; silent_chdir = true;