treewide: update lazy.plugins syntax

This commit is contained in:
Pei Yang Ching 2024-10-17 17:17:18 +02:00
parent 854fd340e3
commit d49e46ab16
13 changed files with 262 additions and 286 deletions

View file

@ -15,8 +15,7 @@ in {
"comment-nvim"
];
vim.lazy.plugins = [
{
vim.lazy.plugins.comment-nvim = {
package = "comment-nvim";
setupModule = "Comment";
inherit (cfg) setupOpts;
@ -41,7 +40,6 @@ in {
(mkLznBinding ["x"] cfg.mappings.toggleSelectedLine "<Plug>(comment_toggle_linewise_visual)" mappings.toggleSelectedLine.description)
(mkLznBinding ["x"] cfg.mappings.toggleSelectedBlock "<Plug>(comment_toggle_blockwise_visual)" mappings.toggleSelectedBlock.description)
];
}
];
};
};
}

View file

@ -54,8 +54,7 @@ in {
vim = {
startPlugins = ["nvim-nio"];
lazy.plugins = [
{
lazy.plugins.nvim-dap-ui = {
package = "nvim-dap-ui";
setupModule = "dapui";
setupOpts = {};
@ -63,8 +62,7 @@ in {
keys = [
(mkSetLuaLznBinding mappings.toggleDapUI "function() require('dapui').toggle() end")
];
}
];
};
pluginRC.nvim-dap-ui = entryAfter ["nvim-dap"] (
optionalString cfg.ui.autoStart ''

View file

@ -16,15 +16,13 @@ in {
"nui-nvim" # ui library
];
lazy.plugins = [
{
lazy.plugins.neo-tree-nvim = {
package = "neo-tree-nvim";
setupModule = "neo-tree";
inherit (cfg) setupOpts;
cmd = ["Neotree"];
}
];
};
visuals.nvimWebDevicons.enable = true;
};

View file

@ -15,12 +15,12 @@
inherit (self.options.vim.filetree.nvimTree) mappings;
in {
config = mkIf cfg.enable {
vim.binds.whichKey.register = pushDownDefault {
vim = {
binds.whichKey.register = pushDownDefault {
"<leader>t" = "+NvimTree";
};
vim.lazy.plugins = [
{
lazy.plugins.nvim-tree-lua = {
package = "nvim-tree-lua";
setupModule = "nvim-tree";
inherit (cfg) setupOpts;
@ -31,10 +31,9 @@ in {
(mkLznBinding ["n"] cfg.mappings.findFile ":NvimTreeFindFile<cr>" mappings.findFile.description)
(mkLznBinding ["n"] cfg.mappings.focus ":NvimTreeFocus<cr>" mappings.focus.description)
];
}
];
};
vim.pluginRC.nvimtreelua = entryAnywhere ''
pluginRC.nvimtreelua = entryAnywhere ''
${
optionalString cfg.setupOpts.disable_netrw ''
-- disable netrew completely
@ -85,4 +84,5 @@ in {
}
'';
};
};
}

View file

@ -14,8 +14,7 @@
in {
config = mkIf (cfg.enable && cfg.trouble.enable) {
vim = {
lazy.plugins = [
{
lazy.plugins.trouble = {
package = "trouble";
setupModule = "trouble";
inherit (cfg.trouble) setupOpts;
@ -29,8 +28,7 @@ in {
(mkSetLznBinding mappings.quickfix "<cmd>TroubleToggle quickfix<CR>")
(mkSetLznBinding mappings.locList "<cmd>TroubleToggle loclist<CR>")
];
}
];
};
binds.whichKey.register = pushDownDefault {
"<leader>l" = "Trouble";

View file

@ -14,8 +14,7 @@
in {
config = mkIf cfg.enable {
vim = {
lazy.plugins = [
{
lazy.plugins.toggleterm-nvim = {
package = "toggleterm-nvim";
cmd = ["ToggleTerm" "ToggleTermSendCurrentLine" "ToggleTermSendVisualLines" "ToggleTermSendVisualSelection" "ToggleTermSetName" "ToggleTermToggleAll"];
keys = [
@ -45,8 +44,7 @@ in {
vim.keymap.set('n', ${toJSON cfg.lazygit.mappings.open}, function() lazygit:toggle() end, {silent = true, noremap = true, desc = '${lazygitMapDesc}'})
'';
}
];
};
};
};
}

View file

@ -9,15 +9,13 @@
cfg = config.vim.binds.cheatsheet;
in {
config = mkIf cfg.enable {
vim.lazy.plugins = [
{
vim.lazy.plugins.cheatsheet-nvim = {
package = "cheatsheet-nvim";
setupModule = "cheatsheet";
setupOpts = {};
cmd = ["Cheatsheet" "CheatsheetEdit"];
before = optionalString config.vim.lazy.enable "require('lz.n').trigger_load('telescope')";
}
];
};
};
}

View file

@ -10,14 +10,12 @@ in {
config = mkIf cfg.enable {
vim = {
startPlugins = ["plenary-nvim"];
lazy.plugins = [
{
lazy.plugins.diffview-nvim = {
package = "diffview-nvim";
cmd = ["DiffviewClose" "DiffviewFileHistory" "DiffviewFocusFiles" "DiffviewLog" "DiffviewOpen" "DiffviewRefresh" "DiffviewToggleFiles"];
setupModule = "diffview";
inherit (cfg) setupOpts;
}
];
};
};
};
}

View file

@ -10,8 +10,7 @@ in {
config = mkIf cfg.enable {
vim.startPlugins = ["dressing-nvim"];
vim.lazy.plugins = [
{
vim.lazy.plugins.icon-picker-nvim = {
package = "icon-picker-nvim";
setupModule = "icon-picker";
setupOpts = {
@ -19,7 +18,6 @@ in {
};
cmd = ["IconPickerInsert" "IconPickerNormal" "IconPickerYank"];
}
];
};
};
}

View file

@ -11,8 +11,7 @@ in {
config = mkIf cfg.enable {
vim = {
startPlugins = ["vim-repeat"];
lazy.plugins = [
{
lazy.plugins.leap-nvim = {
package = "leap-nvim";
keys = [
(mkLznBinding ["n" "o" "x"] cfg.mappings.leapForwardTo "<Plug>(leap-forward-to)" "Leap forward to")
@ -54,8 +53,7 @@ in {
},
}
'';
}
];
};
};
};
}

View file

@ -30,8 +30,7 @@ in {
startPlugins = ["nvim-surround"];
pluginRC.surround = entryAnywhere "require('nvim-surround').setup(${toLuaObject cfg.setupOpts})";
lazy.plugins = [
{
lazy.plugins.nvim-surround = {
package = "nvim-surround";
setupModule = "nvim-surround";
inherit (cfg) setupOpts;
@ -48,8 +47,7 @@ in {
change
change_line
]);
}
];
};
utility.surround.setupOpts.keymaps = mkIf cfg.useVendoredKeybindings vendoredKeybinds;
};

View file

@ -20,8 +20,7 @@ in {
vim = {
startPlugins = ["plenary-nvim"];
lazy.plugins = [
{
lazy.plugins.telescope = {
package = "telescope";
setupModule = "telescope";
inherit (cfg) setupOpts;
@ -69,8 +68,7 @@ in {
(mkSetLznBinding mappings.findProjects "<cmd Telescope projects<CR>")
]
);
}
];
};
binds.whichKey.register = pushDownDefault {
"<leader>f" = "+Telescope";

View file

@ -8,13 +8,11 @@
cfg = config.vim.visuals.fidget-nvim;
in {
config = mkIf cfg.enable {
vim.lazy.plugins = [
{
vim.lazy.plugins.fidget-nvim = {
package = "fidget-nvim";
setupModule = "fidget";
event = "LspAttach";
inherit (cfg) setupOpts;
}
];
};
};
}