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" "comment-nvim"
]; ];
vim.lazy.plugins = [ vim.lazy.plugins.comment-nvim = {
{
package = "comment-nvim"; package = "comment-nvim";
setupModule = "Comment"; setupModule = "Comment";
inherit (cfg) setupOpts; 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.toggleSelectedLine "<Plug>(comment_toggle_linewise_visual)" mappings.toggleSelectedLine.description)
(mkLznBinding ["x"] cfg.mappings.toggleSelectedBlock "<Plug>(comment_toggle_blockwise_visual)" mappings.toggleSelectedBlock.description) (mkLznBinding ["x"] cfg.mappings.toggleSelectedBlock "<Plug>(comment_toggle_blockwise_visual)" mappings.toggleSelectedBlock.description)
]; ];
} };
];
}; };
} }

View file

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

View file

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

View file

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

View file

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

View file

@ -14,8 +14,7 @@
in { in {
config = mkIf cfg.enable { config = mkIf cfg.enable {
vim = { vim = {
lazy.plugins = [ lazy.plugins.toggleterm-nvim = {
{
package = "toggleterm-nvim"; package = "toggleterm-nvim";
cmd = ["ToggleTerm" "ToggleTermSendCurrentLine" "ToggleTermSendVisualLines" "ToggleTermSendVisualSelection" "ToggleTermSetName" "ToggleTermToggleAll"]; cmd = ["ToggleTerm" "ToggleTermSendCurrentLine" "ToggleTermSendVisualLines" "ToggleTermSendVisualSelection" "ToggleTermSetName" "ToggleTermToggleAll"];
keys = [ 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}'}) 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; cfg = config.vim.binds.cheatsheet;
in { in {
config = mkIf cfg.enable { config = mkIf cfg.enable {
vim.lazy.plugins = [ vim.lazy.plugins.cheatsheet-nvim = {
{
package = "cheatsheet-nvim"; package = "cheatsheet-nvim";
setupModule = "cheatsheet"; setupModule = "cheatsheet";
setupOpts = {}; setupOpts = {};
cmd = ["Cheatsheet" "CheatsheetEdit"]; cmd = ["Cheatsheet" "CheatsheetEdit"];
before = optionalString config.vim.lazy.enable "require('lz.n').trigger_load('telescope')"; before = optionalString config.vim.lazy.enable "require('lz.n').trigger_load('telescope')";
} };
];
}; };
} }

View file

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

View file

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

View file

@ -11,8 +11,7 @@ in {
config = mkIf cfg.enable { config = mkIf cfg.enable {
vim = { vim = {
startPlugins = ["vim-repeat"]; startPlugins = ["vim-repeat"];
lazy.plugins = [ lazy.plugins.leap-nvim = {
{
package = "leap-nvim"; package = "leap-nvim";
keys = [ keys = [
(mkLznBinding ["n" "o" "x"] cfg.mappings.leapForwardTo "<Plug>(leap-forward-to)" "Leap forward to") (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"]; startPlugins = ["nvim-surround"];
pluginRC.surround = entryAnywhere "require('nvim-surround').setup(${toLuaObject cfg.setupOpts})"; pluginRC.surround = entryAnywhere "require('nvim-surround').setup(${toLuaObject cfg.setupOpts})";
lazy.plugins = [ lazy.plugins.nvim-surround = {
{
package = "nvim-surround"; package = "nvim-surround";
setupModule = "nvim-surround"; setupModule = "nvim-surround";
inherit (cfg) setupOpts; inherit (cfg) setupOpts;
@ -48,8 +47,7 @@ in {
change change
change_line change_line
]); ]);
} };
];
utility.surround.setupOpts.keymaps = mkIf cfg.useVendoredKeybindings vendoredKeybinds; utility.surround.setupOpts.keymaps = mkIf cfg.useVendoredKeybindings vendoredKeybinds;
}; };

View file

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

View file

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