mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-25 02:08:40 +02:00
plugins/utils/project-nvim: take ownership of telescope integration (#1236)
This commit is contained in:
parent
c2cd3cb7a1
commit
29b6ede12f
4 changed files with 30 additions and 17 deletions
|
@ -14,7 +14,6 @@ in {
|
|||
./fzf-native.nix
|
||||
./fzy-native.nix
|
||||
./media-files.nix
|
||||
./project-nvim.nix
|
||||
./ui-select.nix
|
||||
./undo.nix
|
||||
];
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
{
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
cfg = config.plugins.telescope.extensions.project-nvim;
|
||||
in {
|
||||
options.plugins.telescope.extensions.project-nvim = {
|
||||
enable = mkEnableOption "project-nvim telescope extension";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
plugins.telescope.enabledExtensions = ["projects"];
|
||||
};
|
||||
}
|
|
@ -8,6 +8,12 @@
|
|||
with lib; let
|
||||
cfg = config.plugins.project-nvim;
|
||||
in {
|
||||
imports = [
|
||||
(lib.mkRenamedOptionModule
|
||||
["plugins" "telescope" "extensions" "project-nvim" "enable"]
|
||||
["plugins" "project-nvim" "enableTelescope"])
|
||||
];
|
||||
|
||||
options.plugins.project-nvim =
|
||||
helpers.neovim-plugin.extraOptionsOptions
|
||||
// {
|
||||
|
@ -67,9 +73,20 @@ in {
|
|||
(with types; either str helpers.nixvimTypes.rawLua)
|
||||
''{__raw = "vim.fn.stdpath('data')";}''
|
||||
"Path where project.nvim will store the project history for use in telescope.";
|
||||
|
||||
enableTelescope = mkEnableOption ''
|
||||
When set to true, enabled project-nvim telescope integration.
|
||||
'';
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
warnings =
|
||||
optional
|
||||
(cfg.enableTelescope && (!config.plugins.telescope.enable))
|
||||
''
|
||||
Telescope support for project-nvim is enabled but the telescope plugin is not.
|
||||
'';
|
||||
|
||||
extraPlugins = [cfg.package];
|
||||
|
||||
extraConfigLua = let
|
||||
|
@ -89,5 +106,7 @@ in {
|
|||
in ''
|
||||
require('project_nvim').setup(${helpers.toLuaObject setupOptions})
|
||||
'';
|
||||
|
||||
plugins.telescope.enabledExtensions = mkIf cfg.enableTelescope ["projects"];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -3,6 +3,17 @@
|
|||
plugins.project-nvim.enable = true;
|
||||
};
|
||||
|
||||
telescopeEnabled = {
|
||||
plugins.telescope = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
plugins.project-nvim = {
|
||||
enable = true;
|
||||
enableTelescope = true;
|
||||
};
|
||||
};
|
||||
|
||||
defaults = {
|
||||
plugins.project-nvim = {
|
||||
enable = true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue