Skip to content

Commit c342859

Browse files
authored
feat!(backlinks): Better backlinks buffer (#39)
* feat!(treesitter_fold): Added folding for code blocks Can potentially break existing configs. Take another look at the README.md file. * feat!(backlinks): Now has an option to open it as buffer There is a toggle in the config that can set it to use the fuzzy finder of choice. But now the default is to use the buffer format. * doc: Updated README.md
1 parent a965cf1 commit c342859

File tree

3 files changed

+1616
-1467
lines changed

3 files changed

+1616
-1467
lines changed

README.md

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -89,15 +89,17 @@ return {
8989
load = {
9090
-- MANDATORY
9191
["external.many-mans"] = {
92-
config = {
93-
treesitter_fold = true -- If you don't want @data property ... @end to fold
94-
}
92+
config = {
93+
metadata_fold = true -- If want @data property ... @end to fold
94+
code_fold = true -- If want @code ... @end to fold
95+
}
9596
},
9697
-- OPTIONAL
9798
["external.agenda"] = {},
9899
["external.roam"] = {
99100
config = {
100101
fuzzy_finder = "Telescope" -- OR "Fzf" ... Defaults to "Telescope"
102+
fuzzy_backlinks = false -- Set to "true" for backlinks in fuzzy finder instead of buffer
101103
}
102104
},
103105
})
@@ -234,16 +236,18 @@ You want to insert the block into your cursor location as a link.
234236

235237
### Rationale
236238

237-
Since we are swearing off the file-tree, we need a way to conveniently navigate between nodes. The backlinks offer us an insight into the ways we can get to the current node.
239+
Since we are swearing off the file-tree, we need a way to conveniently navigate
240+
between nodes. The backlinks offer us an insight into the ways we can get to
241+
the current node.
238242

239-
> [!IMPORTANT]
240-
> I believe that using Telescope to list out backlinks and using that as a
241-
> navigation methodology is flawed because you cannot have it open when working
242-
> on a current node. Backlinks should be visible at all times to be truly
243-
> effective, and if I have to press a keymap to open it, it wastes valuable
244-
> time.
245-
>
246-
> TODO change this into a read-only buffer that can be toggled.
243+
There are two options to view backlinks. Depending on whether to the
244+
configuration `fuzzy_backlinks` is set to `false` or `true`:
245+
- `false` - (default) Opens the backlinks as a vertical-split buffer.
246+
- `true` - Opens the backlinks within the selected fuzzy-finder.
247+
248+
As a buffer, the entries are **folded**. You can unfold then to reveal a
249+
preview from where the backlinks are extracted. This isn't necessary with the
250+
fuzzy-finder as it can be configured to show an automatic preview.
247251

248252
### Use-Case
249253

0 commit comments

Comments
 (0)