✨ feat(nvim): add a new extra: grapple
a better harpoon in my opinion
This commit is contained in:
parent
53f257dcbf
commit
5753847a71
4 changed files with 82 additions and 3 deletions
2
.config/nvim/.github/README.md
vendored
2
.config/nvim/.github/README.md
vendored
|
@ -337,6 +337,8 @@
|
||||||
<summary><b>🔖 Marks</b></summary>
|
<summary><b>🔖 Marks</b></summary>
|
||||||
|
|
||||||
- [ThePrimeagen/harpoon](https://dotfyle.com/plugins/ThePrimeagen/harpoon)
|
- [ThePrimeagen/harpoon](https://dotfyle.com/plugins/ThePrimeagen/harpoon)
|
||||||
|
- [otavioschwanck/arrow.nvim](https://dotfyle.com/plugins/otavioschwanck/arrow.nvim)
|
||||||
|
- [cbochs/grapple.nvim](https://dotfyle.com/plugins/cbochs/grapple.nvim)
|
||||||
- [tomasky/bookmarks.nvim](https://dotfyle.com/plugins/tomasky/bookmarks.nvim)
|
- [tomasky/bookmarks.nvim](https://dotfyle.com/plugins/tomasky/bookmarks.nvim)
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
"garbage-day.nvim": { "branch": "main", "commit": "01a43b77459bc06038045afade8f003f08a3d02f" },
|
"garbage-day.nvim": { "branch": "main", "commit": "01a43b77459bc06038045afade8f003f08a3d02f" },
|
||||||
"gitsigns.nvim": { "branch": "main", "commit": "2c2463dbd82eddd7dbab881c3a62cfbfbe3c67ae" },
|
"gitsigns.nvim": { "branch": "main", "commit": "2c2463dbd82eddd7dbab881c3a62cfbfbe3c67ae" },
|
||||||
"glance.nvim": { "branch": "master", "commit": "8ed5cf3b3b1231ea696d88c9efd977027429d869" },
|
"glance.nvim": { "branch": "master", "commit": "8ed5cf3b3b1231ea696d88c9efd977027429d869" },
|
||||||
"harpoon": { "branch": "harpoon2", "commit": "a38be6e0dd4c6db66997deab71fc4453ace97f9c" },
|
"grapple.nvim": { "branch": "main", "commit": "33738f9c76150e8bf711b6d49e219fcc1581bf51" },
|
||||||
"headlines.nvim": { "branch": "master", "commit": "618ef1b2502c565c82254ef7d5b04402194d9ce3" },
|
"headlines.nvim": { "branch": "master", "commit": "618ef1b2502c565c82254ef7d5b04402194d9ce3" },
|
||||||
"hydra.nvim": { "branch": "master", "commit": "55de54543d673824435930ecf533256eea2e565b" },
|
"hydra.nvim": { "branch": "master", "commit": "55de54543d673824435930ecf533256eea2e565b" },
|
||||||
"icon-picker.nvim": { "branch": "master", "commit": "3ee9a0ea9feeef08ae35e40c8be6a2fa2c20f2d3" },
|
"icon-picker.nvim": { "branch": "master", "commit": "3ee9a0ea9feeef08ae35e40c8be6a2fa2c20f2d3" },
|
||||||
|
@ -76,7 +76,7 @@
|
||||||
"nvim-various-textobjs": { "branch": "main", "commit": "3782eb41a964f45788843e34f325a470f0dc6757" },
|
"nvim-various-textobjs": { "branch": "main", "commit": "3782eb41a964f45788843e34f325a470f0dc6757" },
|
||||||
"nvim-web-devicons": { "branch": "master", "commit": "4adea17610d140a99c313e3f79a9dc01825d59ae" },
|
"nvim-web-devicons": { "branch": "master", "commit": "4adea17610d140a99c313e3f79a9dc01825d59ae" },
|
||||||
"nvim_context_vt": { "branch": "master", "commit": "8f7b6b46292e0819290b0d368abc3366b8a163fc" },
|
"nvim_context_vt": { "branch": "master", "commit": "8f7b6b46292e0819290b0d368abc3366b8a163fc" },
|
||||||
"obsidian.nvim": { "branch": "main", "commit": "d0d699ccb020d834b2f095f2d6cc99259cd00b14" },
|
"obsidian.nvim": { "branch": "main", "commit": "6888c7620109684371ed9304df2ba68abc78d558" },
|
||||||
"outline.nvim": { "branch": "main", "commit": "a8d40aecb799196303ff3521c0e31c87bba57198" },
|
"outline.nvim": { "branch": "main", "commit": "a8d40aecb799196303ff3521c0e31c87bba57198" },
|
||||||
"overseer.nvim": { "branch": "master", "commit": "b72f6d23ce47ccd427be2341f389c63448278f17" },
|
"overseer.nvim": { "branch": "master", "commit": "b72f6d23ce47ccd427be2341f389c63448278f17" },
|
||||||
"package-info.nvim": { "branch": "master", "commit": "45acce5b12ce824332d8000cc2c91805b6710446" },
|
"package-info.nvim": { "branch": "master", "commit": "45acce5b12ce824332d8000cc2c91805b6710446" },
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
"plugins.extras.editor.docs.devdocs",
|
"plugins.extras.editor.docs.devdocs",
|
||||||
"plugins.extras.editor.docs.obsidian",
|
"plugins.extras.editor.docs.obsidian",
|
||||||
"plugins.extras.editor.git.diffview",
|
"plugins.extras.editor.git.diffview",
|
||||||
"plugins.extras.editor.harpoon",
|
"plugins.extras.editor.grapple",
|
||||||
"plugins.extras.editor.live-server",
|
"plugins.extras.editor.live-server",
|
||||||
"plugins.extras.editor.outline-extended",
|
"plugins.extras.editor.outline-extended",
|
||||||
"plugins.extras.editor.package-info",
|
"plugins.extras.editor.package-info",
|
||||||
|
|
77
.config/nvim/lua/plugins/extras/editor/grapple.lua
Normal file
77
.config/nvim/lua/plugins/extras/editor/grapple.lua
Normal file
|
@ -0,0 +1,77 @@
|
||||||
|
local keys = {}
|
||||||
|
|
||||||
|
-- stylua: ignore start
|
||||||
|
for i = 1, 9 do
|
||||||
|
table.insert(keys, { "<leader><cr>" .. i, "<cmd>Grapple select index=" .. i .. "<CR>", desc = "File " .. i })
|
||||||
|
end
|
||||||
|
|
||||||
|
table.insert(keys, { "<leader><cr>a", "<cmd>Grapple tag<CR>", desc = "Add Mark" })
|
||||||
|
table.insert(keys, { "<leader><cr><cr>", "<cmd>Grapple toggle_tags<CR>", desc = "Marks" })
|
||||||
|
table.insert(keys, { "<leader><cr>t", "<cmd>Telescope grapple tags<CR>", desc = "Marks (Telescope)" })
|
||||||
|
table.insert(keys, { "<leader><cr>C", "<cmd>Grapple reset<CR>", desc = "Clear all Marks" })
|
||||||
|
table.insert(keys, { "<leader><cr>c", "<cmd>Grapple untag<CR>", desc = "Clear current Mark" })
|
||||||
|
table.insert(keys, { "<leader><cr>s", "<cmd>Grapple toggle_scopes<CR>", desc = "Scopes" })
|
||||||
|
table.insert(keys, { "<leader><cr>S", "<cmd>Grapple toggle_loaded<CR>", desc = "Loaded Scopes" })
|
||||||
|
|
||||||
|
table.insert(keys, { "]<cr>", "<cmd>Grapple cycle forward<CR>", desc = "Next Mark" })
|
||||||
|
table.insert(keys, { "[<cr>", "<cmd>Grapple cycle backward<CR>", desc = "Prev Mark" })
|
||||||
|
|
||||||
|
table.insert(keys, { "<C-A-l>", "<cmd>Grapple cycle forward<CR>", desc = "Next Mark" })
|
||||||
|
table.insert(keys, { "<C-A-h>", "<cmd>Grapple cycle backward<CR>", desc = "Prev Mark" })
|
||||||
|
-- stylua: ignore end
|
||||||
|
|
||||||
|
return {
|
||||||
|
{
|
||||||
|
"cbochs/grapple.nvim",
|
||||||
|
dependencies = "nvim-tree/nvim-web-devicons",
|
||||||
|
cmd = { "Grapple" },
|
||||||
|
keys = keys,
|
||||||
|
config = function()
|
||||||
|
require("grapple").setup()
|
||||||
|
require("lazyvim.util").on_load("telescope.nvim", function()
|
||||||
|
require("telescope").load_extension("grapple")
|
||||||
|
end)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"goolord/alpha-nvim",
|
||||||
|
optional = true,
|
||||||
|
opts = function(_, dashboard)
|
||||||
|
local button = dashboard.button("m", " " .. " Marks", "<cmd>Grapple toggle_tags<CR>")
|
||||||
|
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)
|
||||||
|
local grapple = {
|
||||||
|
action = "Grapple toggle_tags",
|
||||||
|
desc = " Marks",
|
||||||
|
icon = " ",
|
||||||
|
key = "m",
|
||||||
|
}
|
||||||
|
|
||||||
|
grapple.desc = grapple.desc .. string.rep(" ", 43 - #grapple.desc)
|
||||||
|
grapple.key_format = " %s"
|
||||||
|
|
||||||
|
table.insert(opts.config.center, 5, grapple)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"nvim-lualine/lualine.nvim",
|
||||||
|
opts = function(_, opts)
|
||||||
|
table.insert(opts.sections.lualine_c, { require("grapple").statusline, cond = require("grapple").exists })
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"folke/which-key.nvim",
|
||||||
|
opts = {
|
||||||
|
defaults = {
|
||||||
|
["<leader><cr>"] = { name = " grapple" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue