2023-10-26 12:03:58 +00:00
|
|
|
{lib, ...}: let
|
2024-03-12 00:46:29 +00:00
|
|
|
inherit (lib.options) mkEnableOption mkOption;
|
|
|
|
inherit (lib.types) enum int;
|
|
|
|
inherit (lib.nvim.binds) mkMappingOption;
|
2023-10-26 12:03:58 +00:00
|
|
|
in {
|
|
|
|
options.vim.lsp.nvim-docs-view = {
|
|
|
|
enable = mkEnableOption "nvim-docs-view, for displaying lsp hover documentation in a side panel.";
|
|
|
|
|
|
|
|
position = mkOption {
|
2024-03-12 00:46:29 +00:00
|
|
|
type = enum ["left" "right" "top" "bottom"];
|
2023-10-26 12:03:58 +00:00
|
|
|
default = "right";
|
|
|
|
description = ''
|
|
|
|
Where to open the docs view panel
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
height = mkOption {
|
2024-03-12 00:46:29 +00:00
|
|
|
type = int;
|
2023-10-26 12:03:58 +00:00
|
|
|
default = 10;
|
|
|
|
description = ''
|
|
|
|
Height of the docs view panel if the position is set to either top or bottom
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
width = mkOption {
|
2024-03-12 00:46:29 +00:00
|
|
|
type = int;
|
2023-10-26 12:03:58 +00:00
|
|
|
default = 60;
|
|
|
|
description = ''
|
|
|
|
Width of the docs view panel if the position is set to either left or right
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
updateMode = mkOption {
|
2024-03-12 00:46:29 +00:00
|
|
|
type = enum ["auto" "manual"];
|
2023-10-26 12:03:58 +00:00
|
|
|
default = "auto";
|
|
|
|
description = ''
|
2024-03-12 00:46:29 +00:00
|
|
|
Determines the mechanism used to update the docs view panel content
|
|
|
|
|
|
|
|
Possible values:
|
|
|
|
- auto: the content will update upon cursor move.
|
|
|
|
- manual: the content will only update once :DocsViewUpdate is called
|
2023-10-26 12:03:58 +00:00
|
|
|
'';
|
|
|
|
};
|
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";
|
|
|
|
};
|
2023-10-26 12:03:58 +00:00
|
|
|
};
|
|
|
|
}
|