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
|
./fzf-native.nix
|
||||||
./fzy-native.nix
|
./fzy-native.nix
|
||||||
./media-files.nix
|
./media-files.nix
|
||||||
./project-nvim.nix
|
|
||||||
./ui-select.nix
|
./ui-select.nix
|
||||||
./undo.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
|
with lib; let
|
||||||
cfg = config.plugins.project-nvim;
|
cfg = config.plugins.project-nvim;
|
||||||
in {
|
in {
|
||||||
|
imports = [
|
||||||
|
(lib.mkRenamedOptionModule
|
||||||
|
["plugins" "telescope" "extensions" "project-nvim" "enable"]
|
||||||
|
["plugins" "project-nvim" "enableTelescope"])
|
||||||
|
];
|
||||||
|
|
||||||
options.plugins.project-nvim =
|
options.plugins.project-nvim =
|
||||||
helpers.neovim-plugin.extraOptionsOptions
|
helpers.neovim-plugin.extraOptionsOptions
|
||||||
// {
|
// {
|
||||||
|
@ -67,9 +73,20 @@ in {
|
||||||
(with types; either str helpers.nixvimTypes.rawLua)
|
(with types; either str helpers.nixvimTypes.rawLua)
|
||||||
''{__raw = "vim.fn.stdpath('data')";}''
|
''{__raw = "vim.fn.stdpath('data')";}''
|
||||||
"Path where project.nvim will store the project history for use in telescope.";
|
"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 {
|
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];
|
extraPlugins = [cfg.package];
|
||||||
|
|
||||||
extraConfigLua = let
|
extraConfigLua = let
|
||||||
|
@ -89,5 +106,7 @@ in {
|
||||||
in ''
|
in ''
|
||||||
require('project_nvim').setup(${helpers.toLuaObject setupOptions})
|
require('project_nvim').setup(${helpers.toLuaObject setupOptions})
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
plugins.telescope.enabledExtensions = mkIf cfg.enableTelescope ["projects"];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,17 @@
|
||||||
plugins.project-nvim.enable = true;
|
plugins.project-nvim.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
telescopeEnabled = {
|
||||||
|
plugins.telescope = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
plugins.project-nvim = {
|
||||||
|
enable = true;
|
||||||
|
enableTelescope = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
defaults = {
|
defaults = {
|
||||||
plugins.project-nvim = {
|
plugins.project-nvim = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue