mirror of
https://github.com/NotAShelf/neovim-flake.git
synced 2024-12-22 07:39:47 +01:00
Merge pull request #175 from NotAShelf/nvim-docs-view
lsp/nvim-docs-view: add keybinds
This commit is contained in:
commit
a338e4bf9f
2 changed files with 16 additions and 2 deletions
|
@ -3,10 +3,14 @@
|
||||||
lib,
|
lib,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (lib) mkIf nvim;
|
inherit (lib) mkIf nvim addDescriptionsToMappings mkSetBinding mkMerge;
|
||||||
inherit (builtins) toString;
|
inherit (builtins) toString;
|
||||||
|
|
||||||
cfg = config.vim.lsp.nvim-docs-view;
|
cfg = config.vim.lsp.nvim-docs-view;
|
||||||
|
self = import ./nvim-docs-view.nix {inherit lib;};
|
||||||
|
|
||||||
|
mappingDefinitions = self.options.vim.lsp.nvim-docs-view.mappings;
|
||||||
|
mappings = addDescriptionsToMappings cfg.mappings mappingDefinitions;
|
||||||
in {
|
in {
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
vim = {
|
vim = {
|
||||||
|
@ -21,6 +25,11 @@ in {
|
||||||
update_mode = "${cfg.updateMode}",
|
update_mode = "${cfg.updateMode}",
|
||||||
}
|
}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
maps.normal = mkMerge [
|
||||||
|
(mkSetBinding mappings.viewToggle "<cmd>DocsViewToggle<CR>")
|
||||||
|
(mkSetBinding mappings.viewUpdate "<cmd>DocsViewUpdate<CR>")
|
||||||
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{lib, ...}: let
|
{lib, ...}: let
|
||||||
inherit (lib) mkEnableOption mkOption types;
|
inherit (lib) mkEnableOption mkOption types mkMappingOption;
|
||||||
in {
|
in {
|
||||||
options.vim.lsp.nvim-docs-view = {
|
options.vim.lsp.nvim-docs-view = {
|
||||||
enable = mkEnableOption "nvim-docs-view, for displaying lsp hover documentation in a side panel.";
|
enable = mkEnableOption "nvim-docs-view, for displaying lsp hover documentation in a side panel.";
|
||||||
|
@ -37,5 +37,10 @@ in {
|
||||||
- If manual, the content will only update once :DocsViewUpdate is called
|
- If manual, the content will only update once :DocsViewUpdate is called
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
mappings = {
|
||||||
|
viewToggle = mkMappingOption "Open or close the docs view panel" "lvt";
|
||||||
|
viewUpdate = mkMappingOption "Manually update the docs view panel" "lvu";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue