diff --git a/nvim/.config/nvim/lua/plugins/bookmarks.lua b/nvim/.config/nvim/lua/plugins/bookmarks.lua index 40edeef..2803348 100644 --- a/nvim/.config/nvim/lua/plugins/bookmarks.lua +++ b/nvim/.config/nvim/lua/plugins/bookmarks.lua @@ -1,14 +1,18 @@ -vim.keymap.set({ "n", "v" }, "mm", "BookmarksMark", { desc = "Mark current line into active BookmarkList." }) -vim.keymap.set({ "n", "v" }, "mo", "BookmarksGoto", { desc = "Go to bookmark at current active BookmarkList" }) -vim.keymap.set({ "n", "v" }, "ma", "BookmarksCommands", { desc = "Find and trigger a bookmark command." }) -vim.keymap.set({ "n", "v" }, "mg", "BookmarksGotoRecent", { desc = "Go to latest visited/created Bookmark" }) -vim.keymap.set({ "n", "v" }, "ms", "BookmarksSetActiveList", { desc = "Go to latest visited/created Bookmark" }) - return { - "LintaoAmons/bookmarks.nvim", - tag = "v0.5.3", -- optional, pin the plugin at specific version for stability - dependencies = { - { "nvim-telescope/telescope.nvim" }, - { "stevearc/dressing.nvim" } -- optional: to have the same UI shown in the GIF - } + { + "LintaoAmons/bookmarks.nvim", + tag = "v0.5.3", -- optional, pin the plugin at specific version for stability + dependencies = { + { "stevearc/dressing.nvim" } -- optional: to have the same UI shown in the GIF + }, + event = 'VeryLazy', + keys = { + { "mm", "BookmarksMark", mode = { "n", "v" }, desc = "Mark current line into active BookmarkList." }, + { "mo", "BookmarksGoto", mode = { "n", "v" }, desc = "Go to bookmark at current active BookmarkList" }, + { "ma", "BookmarksCommands", mode = { "n", "v" }, desc = "Find and trigger a bookmark command." }, + { "mg", "BookmarksGotoRecent", mode = { "n", "v" }, desc = "Go to latest visited/created Bookmark" }, + { "ms", "BookmarksSetActiveList", mode = { "n", "v" }, desc = "Go to latest visited/created Bookmark" }, + }, + }, + { "nvim-telescope/telescope.nvim", lazy = true }, } diff --git a/nvim/.config/nvim/lua/plugins/git.lua b/nvim/.config/nvim/lua/plugins/git.lua index e4c6e3f..0693db2 100644 --- a/nvim/.config/nvim/lua/plugins/git.lua +++ b/nvim/.config/nvim/lua/plugins/git.lua @@ -11,24 +11,33 @@ return { graph_style = 'unicode', use_per_project_settings = false, }, - config = function(_, opts) - local neogit = require('neogit') - neogit.setup(opts) - vim.keymap.set('n', 'go', neogit.open, { desc = 'Neo[g]it [O]pen' }) - vim.keymap.set('n', 'g.', function() neogit.open({ cwd = '%:p:h' }) end, - { desc = 'Neo[g]it open in current file repository' }) - local diffview = require('diffview') - vim.keymap.set('n', 'gh', diffview.file_history, { desc = '[G]it [H]istory' }) - vim.keymap.set('n', 'g%', function() diffview.file_history(nil, { '%' }) end, - { desc = '[G]it history for [%] current file' }) - end + keys = { + { + 'go', + function() require('neogit').open() end, + desc = 'Neo[g]it [O]pen' + }, + { + 'g.', + function() require('neogit').open({ cwd = '%:p:h' }) end, + desc = 'Neo[g]it open in current file repository' + }, + { + 'gh', + function() require('diffview').file_history() end, + desc = '[G]it [H]istory', + }, + { + 'g%', + function() require('diffview').file_history(nil, { '%' }) end, + desc = '[G]it history for [%] current file' + }, + }, }, { 'FabijanZulj/blame.nvim', - config = function(_, opts) - require('blame').setup(opts) - end, + config = true, cmd = 'BlameToggle', keys = { { 'gb', 'BlameToggle', desc = '[G]it [B]lame toggle' }, diff --git a/nvim/.config/nvim/lua/plugins/init.lua b/nvim/.config/nvim/lua/plugins/init.lua index a74a887..75f1f83 100644 --- a/nvim/.config/nvim/lua/plugins/init.lua +++ b/nvim/.config/nvim/lua/plugins/init.lua @@ -10,14 +10,13 @@ return { opts = { safe_labels = {}, }, - config = function() - vim.keymap.set({ 'n', 'x', 'o' }, 'gs', '(leap)') - vim.keymap.set({ 'n', 'x', 'o' }, 'gS', '(leap-from-window)') - end, dependencies = { "tpope/vim-repeat", }, - lazy = false, + keys = { + { 'gs', '(leap)', mode = { 'n', 'x', 'o' } }, + { 'gS', '(leap-from-window)', mode = { 'n', 'x', 'o' } }, + } }, { @@ -32,10 +31,9 @@ return { default_file_explorer = true, delete_to_trash = true, }, - config = function(_, opts) - require("oil").setup(opts) - vim.keymap.set("n", "-", "Oil", { desc = "Open parent directory" }) - end + keys = { + { "-", "Oil", desc = "Open parent directory" }, + }, }, { @@ -44,12 +42,10 @@ return { opts = { use_default_keymaps = false, }, - config = function(_, opts) - local tsj = require('treesj') - tsj.setup(opts) - vim.keymap.set('n', 'tg', tsj.toggle, { desc = "[T]ree to[g]gle one-line" }) - vim.keymap.set('n', 'tj', tsj.join, { desc = "[T]ree [J]oin one-line" }) - vim.keymap.set('n', 'ts', tsj.split, { desc = "[T]ree [S]plit one-line" }) - end, + keys = { + { 'tg', function() require('treesj').toggle() end, desc = "[T]ree to[g]gle one-line" }, + { 'tj', function() require('treesj').join() end, desc = "[T]ree [J]oin one-line" }, + { 'ts', function() require('treesj').split() end, desc = "[T]ree [S]plit one-line" }, + }, }, }