Skip to content

Commit 46faf91

Browse files
chore(build): auto-generate docs
1 parent fa9c06f commit 46faf91

File tree

2 files changed

+154
-2
lines changed

2 files changed

+154
-2
lines changed

docs/configuration/general.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,8 +293,21 @@ map("n", "<leader>l", "<cmd>Lazy<cr>", { desc = "Lazy" })
293293
-- new file
294294
map("n", "<leader>fn", "<cmd>enew<cr>", { desc = "New File" })
295295

296-
map("n", "<leader>xl", "<cmd>lopen<cr>", { desc = "Location List" })
297-
map("n", "<leader>xq", "<cmd>copen<cr>", { desc = "Quickfix List" })
296+
-- location list
297+
map("n", "<leader>xl", function()
298+
local success, err = pcall(vim.fn.getloclist(0, { winid = 0 }).winid ~= 0 and vim.cmd.lclose or vim.cmd.lopen)
299+
if not success and err then
300+
vim.notify(err, vim.log.levels.ERROR)
301+
end
302+
end, { desc = "Location List" })
303+
304+
-- quickfix list
305+
map("n", "<leader>xq", function()
306+
local success, err = pcall(vim.fn.getqflist({ winid = 0 }).winid ~= 0 and vim.cmd.cclose or vim.cmd.copen)
307+
if not success and err then
308+
vim.notify(err, vim.log.levels.ERROR)
309+
end
310+
end, { desc = "Quickfix List" })
298311

299312
map("n", "[q", vim.cmd.cprev, { desc = "Previous Quickfix" })
300313
map("n", "]q", vim.cmd.cnext, { desc = "Next Quickfix" })

docs/extras/editor/snacks_picker.md

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,145 @@ opts = nil
428428

429429
</Tabs>
430430

431+
## [alpha-nvim](https://github.com/goolord/alpha-nvim) _(optional)_
432+
433+
<Tabs>
434+
435+
<TabItem value="opts" label="Options">
436+
437+
```lua
438+
opts = function(_, dashboard)
439+
local button = dashboard.button("p", "" .. " Projects", [[<cmd> lua Snacks.picker.projects() <cr>]])
440+
button.opts.hl = "AlphaButtons"
441+
button.opts.hl_shortcut = "AlphaShortcut"
442+
table.insert(dashboard.section.buttons.val, 4, button)
443+
end
444+
```
445+
446+
</TabItem>
447+
448+
449+
<TabItem value="code" label="Full Spec">
450+
451+
```lua
452+
{
453+
"goolord/alpha-nvim",
454+
optional = true,
455+
opts = function(_, dashboard)
456+
local button = dashboard.button("p", "" .. " Projects", [[<cmd> lua Snacks.picker.projects() <cr>]])
457+
button.opts.hl = "AlphaButtons"
458+
button.opts.hl_shortcut = "AlphaShortcut"
459+
table.insert(dashboard.section.buttons.val, 4, button)
460+
end,
461+
}
462+
```
463+
464+
</TabItem>
465+
466+
</Tabs>
467+
468+
## [mini.starter](https://github.com/echasnovski/mini.starter) _(optional)_
469+
470+
<Tabs>
471+
472+
<TabItem value="opts" label="Options">
473+
474+
```lua
475+
opts = function(_, opts)
476+
local items = {
477+
{
478+
name = "Projects",
479+
action = [[lua Snacks.picker.projects()]],
480+
section = string.rep(" ", 22) .. "Telescope",
481+
},
482+
}
483+
vim.list_extend(opts.items, items)
484+
end
485+
```
486+
487+
</TabItem>
488+
489+
490+
<TabItem value="code" label="Full Spec">
491+
492+
```lua
493+
{
494+
"echasnovski/mini.starter",
495+
optional = true,
496+
opts = function(_, opts)
497+
local items = {
498+
{
499+
name = "Projects",
500+
action = [[lua Snacks.picker.projects()]],
501+
section = string.rep(" ", 22) .. "Telescope",
502+
},
503+
}
504+
vim.list_extend(opts.items, items)
505+
end,
506+
}
507+
```
508+
509+
</TabItem>
510+
511+
</Tabs>
512+
513+
## [dashboard-nvim](https://github.com/nvimdev/dashboard-nvim) _(optional)_
514+
515+
<Tabs>
516+
517+
<TabItem value="opts" label="Options">
518+
519+
```lua
520+
opts = function(_, opts)
521+
if not vim.tbl_get(opts, "config", "center") then
522+
return
523+
end
524+
local projects = {
525+
action = "lua Snacks.picker.projects()",
526+
desc = " Projects",
527+
icon = "",
528+
key = "p",
529+
}
530+
531+
projects.desc = projects.desc .. string.rep(" ", 43 - #projects.desc)
532+
projects.key_format = " %s"
533+
534+
table.insert(opts.config.center, 3, projects)
535+
end
536+
```
537+
538+
</TabItem>
539+
540+
541+
<TabItem value="code" label="Full Spec">
542+
543+
```lua
544+
{
545+
"nvimdev/dashboard-nvim",
546+
optional = true,
547+
opts = function(_, opts)
548+
if not vim.tbl_get(opts, "config", "center") then
549+
return
550+
end
551+
local projects = {
552+
action = "lua Snacks.picker.projects()",
553+
desc = " Projects",
554+
icon = "",
555+
key = "p",
556+
}
557+
558+
projects.desc = projects.desc .. string.rep(" ", 43 - #projects.desc)
559+
projects.key_format = " %s"
560+
561+
table.insert(opts.config.center, 3, projects)
562+
end,
563+
}
564+
```
565+
566+
</TabItem>
567+
568+
</Tabs>
569+
431570
## [flash.nvim](https://github.com/folke/flash.nvim) _(optional)_
432571

433572
<Tabs>

0 commit comments

Comments
 (0)