nvf/modules/plugins/lsp/nvim-docs-view/nvim-docs-view.nix

63 lines
1.9 KiB
Nix
Raw Normal View History

{lib, ...}: let
inherit (lib.options) mkEnableOption mkOption;
inherit (lib.nvim.binds) mkMappingOption;
2024-02-17 15:10:45 +00:00
inherit (lib) types mkRenamedOptionModule;
in {
2024-02-17 15:10:45 +00:00
imports = let
renamedSetupOption = oldPath: newPath:
mkRenamedOptionModule
(["vim" "lsp" "nvim-docs-view"] ++ oldPath)
(["vim" "lsp" "nvim-docs-view" "setupOpts"] ++ newPath);
in [
(renamedSetupOption ["position"] ["position"])
(renamedSetupOption ["width"] ["width"])
(renamedSetupOption ["height"] ["height"])
(renamedSetupOption ["updateMode"] ["update_mode"])
];
options.vim.lsp.nvim-docs-view = {
enable = mkEnableOption "nvim-docs-view, for displaying lsp hover documentation in a side panel.";
2024-02-17 15:10:45 +00:00
setupOpts = lib.nvim.types.mkPluginSetupOption "nvim-docs-view" {
position = mkOption {
type = types.enum ["left" "right" "top" "bottom"];
default = "right";
description = ''
Where to open the docs view panel
'';
};
2024-02-17 15:10:45 +00:00
height = mkOption {
type = types.int;
default = 10;
description = ''
Height of the docs view panel if the position is set to either top or bottom
'';
};
2024-02-17 15:10:45 +00:00
width = mkOption {
type = types.int;
default = 60;
description = ''
Width of the docs view panel if the position is set to either left or right
'';
};
2024-02-17 15:10:45 +00:00
update_mode = mkOption {
type = types.enum ["auto" "manual"];
default = "auto";
description = ''
Determines the mechanism used to update the docs view panel content.
- If auto, the content will update upon cursor move.
- If manual, the content will only update once :DocsViewUpdate is called
'';
};
};
2023-10-27 06:30:20 +00:00
mappings = {
viewToggle = mkMappingOption "Open or close the docs view panel" "lvt";
viewUpdate = mkMappingOption "Manually update the docs view panel" "lvu";
};
};
}