mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-09-06 10:21:31 +00:00
modules/lsp: add nvim-docs-view
A neovim plugin to display lsp hover documentation in a side panel.
This commit is contained in:
parent
30552a9ec3
commit
ce8fdf0003
8 changed files with 110 additions and 12 deletions
|
@ -16,5 +16,6 @@ _: {
|
|||
./lightbulb
|
||||
./lspkind
|
||||
./lsplines
|
||||
./nvim-docs-view
|
||||
];
|
||||
}
|
||||
|
|
26
modules/lsp/nvim-docs-view/config.nix
Normal file
26
modules/lsp/nvim-docs-view/config.nix
Normal file
|
@ -0,0 +1,26 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf nvim;
|
||||
inherit (builtins) toString;
|
||||
|
||||
cfg = config.vim.lsp.nvim-docs-view;
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
vim = {
|
||||
lsp.enable = true;
|
||||
startPlugins = ["nvim-docs-view"];
|
||||
|
||||
luaConfigRC.nvim-docs-view = nvim.dag.entryAnywhere ''
|
||||
require("docs-view").setup {
|
||||
position = "${cfg.position}",
|
||||
width = ${toString cfg.width},
|
||||
height = ${toString cfg.height},
|
||||
update_mode = "${cfg.updateMode}",
|
||||
}
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
6
modules/lsp/nvim-docs-view/default.nix
Normal file
6
modules/lsp/nvim-docs-view/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
_: {
|
||||
imports = [
|
||||
./config.nix
|
||||
./nvim-docs-view.nix
|
||||
];
|
||||
}
|
41
modules/lsp/nvim-docs-view/nvim-docs-view.nix
Normal file
41
modules/lsp/nvim-docs-view/nvim-docs-view.nix
Normal file
|
@ -0,0 +1,41 @@
|
|||
{lib, ...}: let
|
||||
inherit (lib) mkEnableOption mkOption types;
|
||||
in {
|
||||
options.vim.lsp.nvim-docs-view = {
|
||||
enable = mkEnableOption "nvim-docs-view, for displaying lsp hover documentation in a side panel.";
|
||||
|
||||
position = mkOption {
|
||||
type = types.enum ["left" "right" "top" "bottom"];
|
||||
default = "right";
|
||||
description = ''
|
||||
Where to open the docs view panel
|
||||
'';
|
||||
};
|
||||
|
||||
height = mkOption {
|
||||
type = types.int;
|
||||
default = 10;
|
||||
description = ''
|
||||
Height of the docs view panel if the position is set to either top or bottom
|
||||
'';
|
||||
};
|
||||
|
||||
width = mkOption {
|
||||
type = types.int;
|
||||
default = 60;
|
||||
description = ''
|
||||
Width of the docs view panel if the position is set to either left or right
|
||||
'';
|
||||
};
|
||||
|
||||
updateMode = 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
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue