nvim: use keys to lazy load
This commit is contained in:
parent
1f040c70ab
commit
8403e8437a
@ -1,14 +1,18 @@
|
||||
vim.keymap.set({ "n", "v" }, "mm", "<cmd>BookmarksMark<cr>", { desc = "Mark current line into active BookmarkList." })
|
||||
vim.keymap.set({ "n", "v" }, "mo", "<cmd>BookmarksGoto<cr>", { desc = "Go to bookmark at current active BookmarkList" })
|
||||
vim.keymap.set({ "n", "v" }, "ma", "<cmd>BookmarksCommands<cr>", { desc = "Find and trigger a bookmark command." })
|
||||
vim.keymap.set({ "n", "v" }, "mg", "<cmd>BookmarksGotoRecent<cr>", { desc = "Go to latest visited/created Bookmark" })
|
||||
vim.keymap.set({ "n", "v" }, "ms", "<cmd>BookmarksSetActiveList<cr>", { 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", "<cmd>BookmarksMark<cr>", mode = { "n", "v" }, desc = "Mark current line into active BookmarkList." },
|
||||
{ "mo", "<cmd>BookmarksGoto<cr>", mode = { "n", "v" }, desc = "Go to bookmark at current active BookmarkList" },
|
||||
{ "ma", "<cmd>BookmarksCommands<cr>", mode = { "n", "v" }, desc = "Find and trigger a bookmark command." },
|
||||
{ "mg", "<cmd>BookmarksGotoRecent<cr>", mode = { "n", "v" }, desc = "Go to latest visited/created Bookmark" },
|
||||
{ "ms", "<cmd>BookmarksSetActiveList<cr>", mode = { "n", "v" }, desc = "Go to latest visited/created Bookmark" },
|
||||
},
|
||||
},
|
||||
{ "nvim-telescope/telescope.nvim", lazy = true },
|
||||
}
|
||||
|
@ -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', '<leader>go', neogit.open, { desc = 'Neo[g]it [O]pen' })
|
||||
vim.keymap.set('n', '<leader>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', '<leader>gh', diffview.file_history, { desc = '[G]it [H]istory' })
|
||||
vim.keymap.set('n', '<leader>g%', function() diffview.file_history(nil, { '%' }) end,
|
||||
{ desc = '[G]it history for [%] current file' })
|
||||
end
|
||||
keys = {
|
||||
{
|
||||
'<leader>go',
|
||||
function() require('neogit').open() end,
|
||||
desc = 'Neo[g]it [O]pen'
|
||||
},
|
||||
{
|
||||
'<leader>g.',
|
||||
function() require('neogit').open({ cwd = '%:p:h' }) end,
|
||||
desc = 'Neo[g]it open in current file repository'
|
||||
},
|
||||
{
|
||||
'<leader>gh',
|
||||
function() require('diffview').file_history() end,
|
||||
desc = '[G]it [H]istory',
|
||||
},
|
||||
{
|
||||
'<leader>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 = {
|
||||
{ '<leader>gb', '<cmd>BlameToggle<cr>', desc = '[G]it [B]lame toggle' },
|
||||
|
@ -10,14 +10,13 @@ return {
|
||||
opts = {
|
||||
safe_labels = {},
|
||||
},
|
||||
config = function()
|
||||
vim.keymap.set({ 'n', 'x', 'o' }, 'gs', '<Plug>(leap)')
|
||||
vim.keymap.set({ 'n', 'x', 'o' }, 'gS', '<Plug>(leap-from-window)')
|
||||
end,
|
||||
dependencies = {
|
||||
"tpope/vim-repeat",
|
||||
},
|
||||
lazy = false,
|
||||
keys = {
|
||||
{ 'gs', '<Plug>(leap)', mode = { 'n', 'x', 'o' } },
|
||||
{ 'gS', '<Plug>(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", "-", "<cmd>Oil<CR>", { desc = "Open parent directory" })
|
||||
end
|
||||
keys = {
|
||||
{ "-", "<cmd>Oil<CR>", 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', '<leader>tg', tsj.toggle, { desc = "[T]ree to[g]gle one-line" })
|
||||
vim.keymap.set('n', '<leader>tj', tsj.join, { desc = "[T]ree [J]oin one-line" })
|
||||
vim.keymap.set('n', '<leader>ts', tsj.split, { desc = "[T]ree [S]plit one-line" })
|
||||
end,
|
||||
keys = {
|
||||
{ '<leader>tg', function() require('treesj').toggle() end, desc = "[T]ree to[g]gle one-line" },
|
||||
{ '<leader>tj', function() require('treesj').join() end, desc = "[T]ree [J]oin one-line" },
|
||||
{ '<leader>ts', function() require('treesj').split() end, desc = "[T]ree [S]plit one-line" },
|
||||
},
|
||||
},
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user