mirror of
https://github.com/NotAShelf/nvf.git
synced 2026-02-04 10:55:50 +00:00
feat(project-nvim): custom setup
This commit is contained in:
parent
3f4ef987dd
commit
4db6950558
2 changed files with 69 additions and 83 deletions
|
|
@ -3,10 +3,7 @@
|
|||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.trivial) boolToString;
|
||||
inherit (lib.strings) concatStringsSep;
|
||||
inherit (lib.nvim.dag) entryAnywhere;
|
||||
inherit (lib) mkIf nvim;
|
||||
|
||||
cfg = config.vim.projects.project-nvim;
|
||||
in {
|
||||
|
|
@ -15,40 +12,8 @@ in {
|
|||
"project-nvim"
|
||||
];
|
||||
|
||||
vim.luaConfigRC.project-nvim = entryAnywhere ''
|
||||
require('project_nvim').setup({
|
||||
manual_mode = ${boolToString cfg.manualMode},
|
||||
detection_methods = { ${concatStringsSep ", " (map (x: "\"" + x + "\"") cfg.detectionMethods)} },
|
||||
|
||||
-- All the patterns used to detect root dir, when **"pattern"** is in
|
||||
-- detection_methods
|
||||
patterns = { ${concatStringsSep ", " (map (x: "\"" + x + "\"") cfg.patterns)} },
|
||||
|
||||
-- Table of lsp clients to ignore by name
|
||||
-- eg: { "efm", ... }
|
||||
ignore_lsp = { ${concatStringsSep ", " (map (x: "\"" + x + "\"") cfg.lspIgnored)} },
|
||||
|
||||
-- Don't calculate root dir on specific directories
|
||||
-- Ex: { "~/.cargo/*", ... }
|
||||
exclude_dirs = { ${concatStringsSep ", " (map (x: "\"" + x + "\"") cfg.excludeDirs)} },
|
||||
|
||||
-- Show hidden files in telescope
|
||||
show_hidden = ${boolToString cfg.showHidden},
|
||||
|
||||
-- When set to false, you will get a message when project.nvim changes your
|
||||
-- directory.
|
||||
silent_chdir = ${boolToString cfg.silentChdir},
|
||||
|
||||
-- What scope to change the directory, valid options are
|
||||
-- * global (default)
|
||||
-- * tab
|
||||
-- * win
|
||||
scope_chdir = '${toString cfg.scopeChdir}',
|
||||
|
||||
-- Path where project.nvim will store the project history for use in
|
||||
-- telescope
|
||||
datapath = vim.fn.stdpath("data"),
|
||||
})
|
||||
vim.luaConfigRC.project-nvim = nvim.dag.entryAnywhere ''
|
||||
require('project_nvim').setup(${nvim.lua.toLuaObject cfg.setupOpts})
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue