Skip to content

Commit

Permalink
chore(build): auto-generate docs
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Jan 14, 2025
1 parent 897e790 commit 328d6e4
Show file tree
Hide file tree
Showing 6 changed files with 316 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/configuration/general.md
Original file line number Diff line number Diff line change
Expand Up @@ -349,12 +349,12 @@ end
if vim.fn.executable("lazygit") == 1 then
map("n", "<leader>gg", function() Snacks.lazygit( { cwd = LazyVim.root.git() }) end, { desc = "Lazygit (Root Dir)" })
map("n", "<leader>gG", function() Snacks.lazygit() end, { desc = "Lazygit (cwd)" })
map("n", "<leader>gf", function() Snacks.lazygit.log_file() end, { desc = "Lazygit Current File History" })
map("n", "<leader>gl", function() Snacks.lazygit.log({ cwd = LazyVim.root.git() }) end, { desc = "Lazygit Log" })
map("n", "<leader>gL", function() Snacks.lazygit.log() end, { desc = "Lazygit Log (cwd)" })
map("n", "<leader>gf", function() Snacks.picker.git_log_file() end, { desc = "Git Current File History" })
map("n", "<leader>gl", function() Snacks.picker.git_log({ cwd = LazyVim.root.git() }) end, { desc = "Git Log" })
map("n", "<leader>gL", function() Snacks.picker.git_log() end, { desc = "Git Log (cwd)" })
end

map("n", "<leader>gb", function() Snacks.git.blame_line() end, { desc = "Git Blame Line" })
map("n", "<leader>gb", function() Snacks.picker.git_log_line() end, { desc = "Git Blame Line" })
map({ "n", "x" }, "<leader>gB", function() Snacks.gitbrowse() end, { desc = "Git Browse (open)" })
map({"n", "x" }, "<leader>gY", function()
Snacks.gitbrowse({ open = function(url) vim.fn.setreg("+", url) end, notify = false })
Expand Down
6 changes: 6 additions & 0 deletions docs/extras/editor/fzf.md
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,9 @@ opts = nil

```lua
opts = function()
if LazyVim.pick.want() ~= "fzf" then
return
end
local Keys = require("lazyvim.plugins.lsp.keymaps").get()
-- stylua: ignore
vim.list_extend(Keys, {
Expand All @@ -464,6 +467,9 @@ end
{
"neovim/nvim-lspconfig",
opts = function()
if LazyVim.pick.want() ~= "fzf" then
return
end
local Keys = require("lazyvim.plugins.lsp.keymaps").get()
-- stylua: ignore
vim.list_extend(Keys, {
Expand Down
250 changes: 250 additions & 0 deletions docs/extras/editor/snacks_picker.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,250 @@
# `Snacks_picker`

<!-- plugins:start -->

:::info
You can enable the extra with the `:LazyExtras` command.
Plugins marked as optional will only be configured if they are installed.
:::

### Options

Additional options for this extra can be configured in your [lua/config/options.lua](/configuration/general#options) file:

```lua title="lua/config/options.lua"
-- In case you don't want to use `:LazyExtras`,
-- then you need to set the option below.
vim.g.lazyvim_picker = "snacks"
```

Below you can find a list of included plugins and their default settings.

:::caution
You don't need to copy the default settings to your config.
They are only shown here for reference.
:::

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

## [snacks.nvim](https://github.com/folke/snacks.nvim)

recommended = true,


<Tabs>

<TabItem value="opts" label="Options">

```lua
opts = {
picker = {},
}
```

</TabItem>


<TabItem value="code" label="Full Spec">

```lua
{
"folke/snacks.nvim",
opts = {
picker = {},
},
-- stylua: ignore
keys = {
{ "<leader>,", function() Snacks.picker.buffers() end, desc = "Buffers" },
{ "<leader>/", LazyVim.pick("grep"), desc = "Grep (Root Dir)" },
{ "<leader>:", function() Snacks.picker.command_history() end, desc = "Command History" },
{ "<leader><space>", LazyVim.pick("files"), desc = "Find Files (Root Dir)" },
-- find
{ "<leader>fb", function() Snacks.picker.buffers() end, desc = "Buffers" },
{ "<leader>fc", LazyVim.pick.config_files(), desc = "Find Config File" },
{ "<leader>ff", LazyVim.pick("files"), desc = "Find Files (Root Dir)" },
{ "<leader>fF", LazyVim.pick("files", { root = false }), desc = "Find Files (cwd)" },
{ "<leader>fg", function() Snacks.picker.git_files() end, desc = "Find Files (git-files)" },
{ "<leader>fr", LazyVim.pick("oldfiles"), desc = "Recent" },
{ "<leader>fR", LazyVim.pick("oldfiles", { only_cwd = true }), desc = "Recent (cwd)" },
-- git
{ "<leader>gc", function() Snacks.picker.git_log() end, desc = "Git Log" },
{ "<leader>gs", function() Snacks.picker.git_status() end, desc = "Git Status" },
-- Grep
{ "<leader>sb", function() Snacks.picker.lines() end, desc = "Buffer Lines" },
{ "<leader>sB", function() Snacks.picker.grep_buffers() end, desc = "Grep Open Buffers" },
{ "<leader>sg", LazyVim.pick("live_grep"), desc = "Grep (Root Dir)" },
{ "<leader>sG", LazyVim.pick("live_grep", { root = false }), desc = "Grep (cwd)" },
{ "<leader>sw", LazyVim.pick("grep_word"), desc = "Visual selection or word (Root Dir)", mode = { "n", "x" } },
{ "<leader>sW", LazyVim.pick("grep_word", { root = false }), desc = "Visual selection or word (cwd)", mode = { "n", "x" } },
-- search
{ '<leader>s"', function() Snacks.picker.registers() end, desc = "Registers" },
{ "<leader>sa", function() Snacks.picker.autocmds() end, desc = "Autocmds" },
{ "<leader>sc", function() Snacks.picker.command_history() end, desc = "Command History" },
{ "<leader>sC", function() Snacks.picker.commands() end, desc = "Commands" },
{ "<leader>sd", function() Snacks.picker.diagnostics() end, desc = "Diagnostics" },
{ "<leader>sh", function() Snacks.picker.help() end, desc = "Help Pages" },
{ "<leader>sH", function() Snacks.picker.highlights() end, desc = "Highlights" },
{ "<leader>sj", function() Snacks.picker.jumps() end, desc = "Jumps" },
{ "<leader>sk", function() Snacks.picker.keymaps() end, desc = "Keymaps" },
{ "<leader>sl", function() Snacks.picker.loclist() end, desc = "Location List" },
{ "<leader>sM", function() Snacks.picker.man() end, desc = "Man Pages" },
{ "<leader>sm", function() Snacks.picker.marks() end, desc = "Marks" },
{ "<leader>sR", function() Snacks.picker.resume() end, desc = "Resume" },
{ "<leader>sq", function() Snacks.picker.qflist() end, desc = "Quickfix List" },
{ "<leader>uC", function() Snacks.picker.colorschemes() end, desc = "Colorschemes" },
{ "<leader>qp", function() Snacks.picker.projects() end, desc = "Projects" },
},
}
```

</TabItem>

</Tabs>

## [snacks.nvim](https://github.com/folke/snacks.nvim)

<Tabs>

<TabItem value="opts" label="Options">

```lua
opts = function(_, opts)
if LazyVim.has("trouble.nvim") then
return vim.tbl_deep_extend("force", opts or {}, {
picker = {
actions = require("trouble.sources.snacks").actions,
win = {
input = {
keys = {
["<c-t>"] = {
"trouble_open",
mode = { "n", "i" },
},
},
},
},
},
})
end
end
```

</TabItem>


<TabItem value="code" label="Full Spec">

```lua
{
"folke/snacks.nvim",
opts = function(_, opts)
if LazyVim.has("trouble.nvim") then
return vim.tbl_deep_extend("force", opts or {}, {
picker = {
actions = require("trouble.sources.snacks").actions,
win = {
input = {
keys = {
["<c-t>"] = {
"trouble_open",
mode = { "n", "i" },
},
},
},
},
},
})
end
end,
}
```

</TabItem>

</Tabs>

## [nvim-lspconfig](https://github.com/neovim/nvim-lspconfig)

<Tabs>

<TabItem value="opts" label="Options">

```lua
opts = function()
if LazyVim.pick.want() ~= "snacks" then
return
end
local Keys = require("lazyvim.plugins.lsp.keymaps").get()
-- stylua: ignore
vim.list_extend(Keys, {
{ "gd", function() Snacks.picker.lsp_definitions() end, desc = "Goto Definition", has = "definition" },
{ "gr", function() Snacks.picker.lsp_references() end, nowait = true, desc = "References" },
{ "gI", function() Snacks.picker.lsp_implementations() end, desc = "Goto Implementation" },
{ "gy", function() Snacks.picker.lsp_type_definitions() end, desc = "Goto T[y]pe Definition" },
{ "<leader>ss", function() Snacks.picker.lsp_symbols() end, desc = "LSP Symbols", has = "documentSymbol" },
})
end
```

</TabItem>


<TabItem value="code" label="Full Spec">

```lua
{
"neovim/nvim-lspconfig",
opts = function()
if LazyVim.pick.want() ~= "snacks" then
return
end
local Keys = require("lazyvim.plugins.lsp.keymaps").get()
-- stylua: ignore
vim.list_extend(Keys, {
{ "gd", function() Snacks.picker.lsp_definitions() end, desc = "Goto Definition", has = "definition" },
{ "gr", function() Snacks.picker.lsp_references() end, nowait = true, desc = "References" },
{ "gI", function() Snacks.picker.lsp_implementations() end, desc = "Goto Implementation" },
{ "gy", function() Snacks.picker.lsp_type_definitions() end, desc = "Goto T[y]pe Definition" },
{ "<leader>ss", function() Snacks.picker.lsp_symbols() end, desc = "LSP Symbols", has = "documentSymbol" },
})
end,
}
```

</TabItem>

</Tabs>

## [todo-comments.nvim](https://github.com/folke/todo-comments.nvim) _(optional)_

<Tabs>

<TabItem value="opts" label="Options">

```lua
opts = nil
```

</TabItem>


<TabItem value="code" label="Full Spec">

```lua
{
"folke/todo-comments.nvim",
optional = true,
-- stylua: ignore
keys = {
{ "<leader>st", function() Snacks.picker.todo_comments() end, desc = "Todo" },
{ "<leader>sT", function () Snacks.picker.todo_comments({ keywords = { "TODO", "FIX", "FIXME" } }) end, desc = "Todo/Fix/Fixme" },
},
}
```

</TabItem>

</Tabs>

<!-- plugins:end -->
49 changes: 49 additions & 0 deletions docs/keymaps.md
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,55 @@ Part of [lazyvim.plugins.extras.editor.refactoring](/extras/editor/refactoring)
| <code>&lt;leader&gt;rs</code> | Refactor | **v** |
| <code>&lt;leader&gt;rx</code> | Extract Variable | **v** |

## [snacks.nvim](https://github.com/folke/snacks.nvim.git)
Part of [lazyvim.plugins.extras.editor.snacks_picker](/extras/editor/snacks_picker)

| Key | Description | Mode |
| --- | --- | --- |
| <code>&lt;leader&gt;&lt;space&gt;</code> | Find Files (Root Dir) | **n** |
| <code>&lt;leader&gt;,</code> | Buffers | **n** |
| <code>&lt;leader&gt;/</code> | Grep (Root Dir) | **n** |
| <code>&lt;leader&gt;:</code> | Command History | **n** |
| <code>&lt;leader&gt;fb</code> | Buffers | **n** |
| <code>&lt;leader&gt;fc</code> | Find Config File | **n** |
| <code>&lt;leader&gt;ff</code> | Find Files (Root Dir) | **n** |
| <code>&lt;leader&gt;fF</code> | Find Files (cwd) | **n** |
| <code>&lt;leader&gt;fg</code> | Find Files (git-files) | **n** |
| <code>&lt;leader&gt;fr</code> | Recent | **n** |
| <code>&lt;leader&gt;fR</code> | Recent (cwd) | **n** |
| <code>&lt;leader&gt;gc</code> | Git Log | **n** |
| <code>&lt;leader&gt;gs</code> | Git Status | **n** |
| <code>&lt;leader&gt;qp</code> | Projects | **n** |
| <code>&lt;leader&gt;s"</code> | Registers | **n** |
| <code>&lt;leader&gt;sa</code> | Autocmds | **n** |
| <code>&lt;leader&gt;sb</code> | Buffer Lines | **n** |
| <code>&lt;leader&gt;sB</code> | Grep Open Buffers | **n** |
| <code>&lt;leader&gt;sc</code> | Command History | **n** |
| <code>&lt;leader&gt;sC</code> | Commands | **n** |
| <code>&lt;leader&gt;sd</code> | Diagnostics | **n** |
| <code>&lt;leader&gt;sg</code> | Grep (Root Dir) | **n** |
| <code>&lt;leader&gt;sG</code> | Grep (cwd) | **n** |
| <code>&lt;leader&gt;sh</code> | Help Pages | **n** |
| <code>&lt;leader&gt;sH</code> | Highlights | **n** |
| <code>&lt;leader&gt;sj</code> | Jumps | **n** |
| <code>&lt;leader&gt;sk</code> | Keymaps | **n** |
| <code>&lt;leader&gt;sl</code> | Location List | **n** |
| <code>&lt;leader&gt;sm</code> | Marks | **n** |
| <code>&lt;leader&gt;sM</code> | Man Pages | **n** |
| <code>&lt;leader&gt;sq</code> | Quickfix List | **n** |
| <code>&lt;leader&gt;sR</code> | Resume | **n** |
| <code>&lt;leader&gt;sw</code> | Visual selection or word (Root Dir) | **n**, **x** |
| <code>&lt;leader&gt;sW</code> | Visual selection or word (cwd) | **n**, **x** |
| <code>&lt;leader&gt;uC</code> | Colorschemes | **n** |

## [todo-comments.nvim](https://github.com/folke/todo-comments.nvim.git)
Part of [lazyvim.plugins.extras.editor.snacks_picker](/extras/editor/snacks_picker)

| Key | Description | Mode |
| --- | --- | --- |
| <code>&lt;leader&gt;st</code> | Todo | **n** |
| <code>&lt;leader&gt;sT</code> | Todo/Fix/Fixme | **n** |

## [nvim-ansible](https://github.com/mfussenegger/nvim-ansible.git)
Part of [lazyvim.plugins.extras.lang.ansible](/extras/lang/ansible)

Expand Down
1 change: 1 addition & 0 deletions docs/plugins/editor.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import TabItem from '@theme/TabItem';
### Includes the following extras

- [editor.fzf](/extras/editor/fzf)
- [editor.snacks_picker](/extras/editor/snacks_picker)
- [editor.telescope](/extras/editor/telescope)

## [neo-tree.nvim](https://github.com/nvim-neo-tree/neo-tree.nvim)
Expand Down
6 changes: 6 additions & 0 deletions docs/plugins/ui.md
Original file line number Diff line number Diff line change
Expand Up @@ -617,6 +617,9 @@ opts = {
opts = {
dashboard = {
preset = {
pick = function(cmd, opts)
return LazyVim.pick(cmd, opts)()
end,
header = [[
██╗ █████╗ ███████╗██╗ ██╗██╗ ██╗██╗███╗ ███╗ Z
██║ ██╔══██╗╚══███╔╝╚██╗ ██╔╝██║ ██║██║████╗ ████║ Z
Expand Down Expand Up @@ -654,6 +657,9 @@ opts = {
opts = {
dashboard = {
preset = {
pick = function(cmd, opts)
return LazyVim.pick(cmd, opts)()
end,
header = [[
██╗ █████╗ ███████╗██╗ ██╗██╗ ██╗██╗███╗ ███╗ Z
██║ ██╔══██╗╚══███╔╝╚██╗ ██╔╝██║ ██║██║████╗ ████║ Z
Expand Down

0 comments on commit 328d6e4

Please sign in to comment.