mirror of
https://github.com/NotAShelf/nvf.git
synced 2024-12-29 06:02:23 +00:00
Merge pull request #504 from diniamo/surround-cleanup
surround: cleanup
This commit is contained in:
commit
ea3d488cf4
1 changed files with 15 additions and 33 deletions
|
@ -4,51 +4,33 @@
|
|||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.nvim.dag) entryAnywhere;
|
||||
inherit (lib.nvim.lua) toLuaObject;
|
||||
|
||||
cfg = config.vim.utility.surround;
|
||||
mkLznKey = mode: key: {
|
||||
inherit key mode;
|
||||
inherit mode key;
|
||||
};
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
vim = {
|
||||
startPlugins = ["nvim-surround"];
|
||||
pluginRC.surround = entryAnywhere "require('nvim-surround').setup(${toLuaObject cfg.setupOpts})";
|
||||
|
||||
lazy.plugins.nvim-surround = {
|
||||
package = "nvim-surround";
|
||||
|
||||
setupModule = "nvim-surround";
|
||||
inherit (cfg) setupOpts;
|
||||
|
||||
keys =
|
||||
[
|
||||
(mkLznKey ["i"] cfg.setupOpts.keymaps.insert)
|
||||
(mkLznKey ["i"] cfg.setupOpts.keymaps.insert_line)
|
||||
(mkLznKey ["x"] cfg.setupOpts.keymaps.visual)
|
||||
(mkLznKey ["x"] cfg.setupOpts.keymaps.visual_line)
|
||||
(mkLznKey ["n"] cfg.setupOpts.keymaps.normal)
|
||||
(mkLznKey ["n"] cfg.setupOpts.keymaps.normal_cur)
|
||||
(mkLznKey ["n"] cfg.setupOpts.keymaps.normal_line)
|
||||
(mkLznKey ["n"] cfg.setupOpts.keymaps.normal_cur_line)
|
||||
(mkLznKey ["n"] cfg.setupOpts.keymaps.delete)
|
||||
(mkLznKey ["n"] cfg.setupOpts.keymaps.change)
|
||||
(mkLznKey ["n"] cfg.setupOpts.keymaps.change_line)
|
||||
]
|
||||
++ map (mkLznKey ["n" "i" "v"]) [
|
||||
"<Plug>(nvim-surround-insert)"
|
||||
"<Plug>(nvim-surround-insert-line)"
|
||||
"<Plug>(nvim-surround-normal)"
|
||||
"<Plug>(nvim-surround-normal-cur)"
|
||||
"<Plug>(nvim-surround-normal-line)"
|
||||
"<Plug>(nvim-surround-normal-cur-line)"
|
||||
"<Plug>(nvim-surround-visual)"
|
||||
"<Plug>(nvim-surround-visual-line)"
|
||||
"<Plug>(nvim-surround-delete)"
|
||||
"<Plug>(nvim-surround-change)"
|
||||
"<Plug>(nvim-surround-change-line)"
|
||||
];
|
||||
keys = [
|
||||
(mkLznKey "i" cfg.setupOpts.keymaps.insert)
|
||||
(mkLznKey "i" cfg.setupOpts.keymaps.insert_line)
|
||||
(mkLznKey "x" cfg.setupOpts.keymaps.visual)
|
||||
(mkLznKey "x" cfg.setupOpts.keymaps.visual_line)
|
||||
(mkLznKey "n" cfg.setupOpts.keymaps.normal)
|
||||
(mkLznKey "n" cfg.setupOpts.keymaps.normal_cur)
|
||||
(mkLznKey "n" cfg.setupOpts.keymaps.normal_line)
|
||||
(mkLznKey "n" cfg.setupOpts.keymaps.normal_cur_line)
|
||||
(mkLznKey "n" cfg.setupOpts.keymaps.delete)
|
||||
(mkLznKey "n" cfg.setupOpts.keymaps.change)
|
||||
(mkLznKey "n" cfg.setupOpts.keymaps.change_line)
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue