♻️ refactor(nvim): harpoon and arrow extra are now identified as marks
This commit is contained in:
parent
a1f04f1323
commit
15d0a0f3d7
2 changed files with 44 additions and 15 deletions
|
@ -7,11 +7,11 @@ return {
|
||||||
},
|
},
|
||||||
keys = {
|
keys = {
|
||||||
{
|
{
|
||||||
"<leader>h",
|
"<leader><cr>",
|
||||||
function()
|
function()
|
||||||
require("arrow.ui").openMenu()
|
require("arrow.ui").openMenu()
|
||||||
end,
|
end,
|
||||||
desc = "Harpoon",
|
desc = "Marks",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -21,4 +21,33 @@ return {
|
||||||
table.insert(opts.sections.lualine_c, require("arrow.statusline").text_for_statusline_with_icons())
|
table.insert(opts.sections.lualine_c, require("arrow.statusline").text_for_statusline_with_icons())
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"goolord/alpha-nvim",
|
||||||
|
optional = true,
|
||||||
|
opts = function(_, dashboard)
|
||||||
|
-- stylua: ignore
|
||||||
|
local button = dashboard.button("m", " " .. " Marks", function() require("arrow.ui").openMenu() end)
|
||||||
|
button.opts.hl = "AlphaButtons"
|
||||||
|
button.opts.hl_shortcut = "AlphaShortcut"
|
||||||
|
table.insert(dashboard.section.buttons.val, 5, button)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"nvimdev/dashboard-nvim",
|
||||||
|
optional = true,
|
||||||
|
opts = function(_, opts)
|
||||||
|
-- stylua: ignore
|
||||||
|
local arrow = {
|
||||||
|
action = function() require("arrow.ui").openMenu() end,
|
||||||
|
desc = " Marks",
|
||||||
|
icon = " ",
|
||||||
|
key = "m",
|
||||||
|
}
|
||||||
|
|
||||||
|
arrow.desc = arrow.desc .. string.rep(" ", 43 - #arrow.desc)
|
||||||
|
arrow.key_format = " %s"
|
||||||
|
|
||||||
|
table.insert(opts.config.center, 5, arrow)
|
||||||
|
end,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,19 +2,19 @@ local keys = {}
|
||||||
|
|
||||||
-- stylua: ignore start
|
-- stylua: ignore start
|
||||||
for i = 1, 9 do
|
for i = 1, 9 do
|
||||||
table.insert(keys, { "<leader>h" .. i, function() require("harpoon"):list():select(i) end, desc = "File " .. i })
|
table.insert(keys, { "<leader><cr>" .. i, function() require("harpoon"):list():select(i) end, desc = "File " .. i })
|
||||||
end
|
end
|
||||||
|
|
||||||
table.insert(keys, { "<leader>ha", function() require("harpoon"):list():append() end, desc = "Add Mark" })
|
table.insert(keys, { "<leader><cr>a", function() require("harpoon"):list():append() end, desc = "Add Mark" })
|
||||||
table.insert(keys, { "<leader>hh", function() require("harpoon").ui:toggle_quick_menu(require("harpoon"):list()) end, desc = "Menu" })
|
table.insert(keys, { "<leader><cr><cr>", function() require("harpoon").ui:toggle_quick_menu(require("harpoon"):list()) end, desc = "Marks" })
|
||||||
table.insert(keys, { "<leader>hf", "<cmd>Telescope harpoon marks<CR>", desc = "Files (Telescope)" })
|
table.insert(keys, { "<leader><cr>t", "<cmd>Telescope harpoon marks<CR>", desc = "Files (Telescope)" })
|
||||||
table.insert(keys, { "<leader>hc", function() require("harpoon"):list():clear() end, desc = "Clear all Files" })
|
table.insert(keys, { "<leader><cr>c", function() require("harpoon"):list():clear() end, desc = "Clear all Files" })
|
||||||
|
|
||||||
table.insert(keys, { "]H", function() require("harpoon"):list():next() end, desc = "Next Harpoon File" })
|
table.insert(keys, { "]<cr>", function() require("harpoon"):list():next() end, desc = "Next Mark File" })
|
||||||
table.insert(keys, { "[H", function() require("harpoon"):list():prev() end, desc = "Prev Harpoon File" })
|
table.insert(keys, { "[<cr>", function() require("harpoon"):list():prev() end, desc = "Prev Mark File" })
|
||||||
|
|
||||||
table.insert(keys, { "<C-A-l>", function() require("harpoon"):list():next() end, desc = "Next Harpoon File" })
|
table.insert(keys, { "<C-A-l>", function() require("harpoon"):list():next() end, desc = "Next Mark File" })
|
||||||
table.insert(keys, { "<C-A-h>", function() require("harpoon"):list():prev() end, desc = "Prev Harpoon File" })
|
table.insert(keys, { "<C-A-h>", function() require("harpoon"):list():prev() end, desc = "Prev Mark File" })
|
||||||
-- stylua: ignore end
|
-- stylua: ignore end
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
@ -55,7 +55,7 @@ return {
|
||||||
"goolord/alpha-nvim",
|
"goolord/alpha-nvim",
|
||||||
optional = true,
|
optional = true,
|
||||||
opts = function(_, dashboard)
|
opts = function(_, dashboard)
|
||||||
local button = dashboard.button("h", " " .. " Harpoon", "<cmd>Telescope harpoon marks<CR>")
|
local button = dashboard.button("m", " " .. " Marks", "<cmd>Telescope harpoon marks<CR>")
|
||||||
button.opts.hl = "AlphaButtons"
|
button.opts.hl = "AlphaButtons"
|
||||||
button.opts.hl_shortcut = "AlphaShortcut"
|
button.opts.hl_shortcut = "AlphaShortcut"
|
||||||
table.insert(dashboard.section.buttons.val, 5, button)
|
table.insert(dashboard.section.buttons.val, 5, button)
|
||||||
|
@ -67,9 +67,9 @@ return {
|
||||||
opts = function(_, opts)
|
opts = function(_, opts)
|
||||||
local harpoon = {
|
local harpoon = {
|
||||||
action = "Telescope harpoon marks",
|
action = "Telescope harpoon marks",
|
||||||
desc = " Harpoon",
|
desc = " Marks",
|
||||||
icon = " ",
|
icon = " ",
|
||||||
key = "h",
|
key = "m",
|
||||||
}
|
}
|
||||||
|
|
||||||
harpoon.desc = harpoon.desc .. string.rep(" ", 43 - #harpoon.desc)
|
harpoon.desc = harpoon.desc .. string.rep(" ", 43 - #harpoon.desc)
|
||||||
|
@ -82,7 +82,7 @@ return {
|
||||||
"folke/which-key.nvim",
|
"folke/which-key.nvim",
|
||||||
opts = {
|
opts = {
|
||||||
defaults = {
|
defaults = {
|
||||||
["<leader>h"] = { name = " harpoon" },
|
["<leader><cr>"] = { name = " marks" },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Reference in a new issue