mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-26 10:48:35 +02:00
plugins/misc: adapt to new maps options
This commit is contained in:
parent
574fb73258
commit
dd6a114e52
18 changed files with 262 additions and 193 deletions
|
@ -110,30 +110,35 @@ in {
|
|||
mkIf cfg.enable {
|
||||
extraPlugins = [pkgs.vimPlugins.nvim-lspconfig];
|
||||
|
||||
maps.normal = let
|
||||
keymaps = let
|
||||
mkMaps = prefix:
|
||||
mapAttrs
|
||||
(key: action: let
|
||||
actionStr =
|
||||
if isString action
|
||||
then action
|
||||
else action.action;
|
||||
actionProps =
|
||||
if isString action
|
||||
then {}
|
||||
else filterAttrs (n: v: n != "action") action;
|
||||
in
|
||||
{
|
||||
inherit (cfg.keymaps) silent;
|
||||
mapAttrsToList
|
||||
(
|
||||
key: action: let
|
||||
actionStr =
|
||||
if isString action
|
||||
then action
|
||||
else action.action;
|
||||
actionProps =
|
||||
if isString action
|
||||
then {}
|
||||
else filterAttrs (n: v: n != "action") action;
|
||||
in {
|
||||
mode = "n";
|
||||
inherit key;
|
||||
action = prefix + actionStr;
|
||||
lua = true;
|
||||
|
||||
options =
|
||||
{
|
||||
inherit (cfg.keymaps) silent;
|
||||
}
|
||||
// actionProps;
|
||||
}
|
||||
// actionProps);
|
||||
);
|
||||
in
|
||||
mkMerge [
|
||||
(mkMaps "vim.diagnostic." cfg.keymaps.diagnostic)
|
||||
(mkMaps "vim.lsp.buf." cfg.keymaps.lspBuf)
|
||||
];
|
||||
(mkMaps "vim.diagnostic." cfg.keymaps.diagnostic)
|
||||
++ (mkMaps "vim.lsp.buf." cfg.keymaps.lspBuf);
|
||||
|
||||
# Enable all LSP servers
|
||||
extraConfigLua = ''
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue