Skip to content

Commit

Permalink
fix(grapple-nvim)!: update to Grapple v0.10.0 (#779)
Browse files Browse the repository at this point in the history
fix(grapple): update after rewrite

Co-authored-by: Calvin Bochulak <calvin@Calvins-MBP.lan>
  • Loading branch information
cbochs and Calvin Bochulak authored Mar 1, 2024
1 parent 5f484ba commit 30e8aae
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
9 changes: 5 additions & 4 deletions lua/astrocommunity/motion/grapple-nvim/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Neovim plugin for tagging important files
**Repository:** <https://github.com/cbochs/grapple.nvim>

### Example of a custom Heirline component for AstroNvim

![image](https://github.com/Subjective/astrocommunity/assets/56745535/333069eb-dea7-428f-b28d-31fd5912f95f)

```lua
Expand All @@ -14,13 +15,14 @@ status.component.grapple = {
provider = function()
local available, grapple = pcall(require, "grapple")
if available then
local key = grapple.key { buffer = 0 }
if key ~= nil then return "" .. key .. " " end
return grapple.statusline()
end
end,
}
```

**Example Configuration:**

```lua
return {
plugins = {
Expand All @@ -34,8 +36,7 @@ return {
provider = function()
local available, grapple = pcall(require, "grapple")
if available then
local key = grapple.key { buffer = 0 }
if key ~= nil then return "" .. key .. " " end
return grapple.statusline()
end
end,
}
Expand Down
18 changes: 9 additions & 9 deletions lua/astrocommunity/motion/grapple-nvim/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ maps.n[prefix] = { desc = icon .. "Grapple" }
require("astronvim.utils").set_mappings(maps)
return {
"cbochs/grapple.nvim",
dependencies = { "nvim-lua/plenary.nvim" },
cmd = { "Grapple" },
keys = {
{ prefix .. "a", "<cmd>GrappleTag<CR>", desc = "Add file" },
{ prefix .. "d", "<cmd>GrappleUntag<CR>", desc = "Remove file" },
{ prefix .. "t", "<cmd>GrappleToggle<CR>", desc = "Toggle a file" },
{ prefix .. "e", "<cmd>GrapplePopup tags<CR>", desc = "Select from tags" },
{ prefix .. "s", "<cmd>GrapplePopup scopes<CR>", desc = "Select a project scope" },
{ prefix .. "x", "<cmd>GrappleReset<CR>", desc = "Clear tags from current project" },
{ "<C-n>", "<cmd>GrappleCycle forward<CR>", desc = "Select next tag" },
{ "<C-p>", "<cmd>GrappleCycle backward<CR>", desc = "Select previous tag" },
{ prefix .. "a", "<cmd>Grapple tag<CR>", desc = "Add file" },
{ prefix .. "d", "<cmd>Grapple untag<CR>", desc = "Remove file" },
{ prefix .. "t", "<cmd>Grapple toggle<CR>", desc = "Toggle a file" },
{ prefix .. "e", "<cmd>Grapple open_tags<CR>", desc = "Select from tags" },
{ prefix .. "s", "<cmd>Grapple open_scopes<CR>", desc = "Select a scope" },
{ prefix .. "l", "<cmd>Grapple open_loaded<CR>", desc = "Select a loaded scope" },
{ prefix .. "x", "<cmd>Grapple reset<CR>", desc = "Clear tags from current project" },
{ "<C-n>", "<cmd>Grapple cycle forward<CR>", desc = "Select next tag" },
{ "<C-p>", "<cmd>Grapple cycle backward<CR>", desc = "Select previous tag" },
},
}

0 comments on commit 30e8aae

Please sign in to comment.