Skip to content

Commit 45071bf

Browse files
chore(build): auto-generate docs
1 parent 4662181 commit 45071bf

File tree

8 files changed

+658
-290
lines changed

8 files changed

+658
-290
lines changed

docs/extras/editor/fzf.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -444,9 +444,6 @@ opts = nil
444444

445445
```lua
446446
opts = function()
447-
if LazyVim.pick.want() ~= "fzf" then
448-
return
449-
end
450447
local Keys = require("lazyvim.plugins.lsp.keymaps").get()
451448
-- stylua: ignore
452449
vim.list_extend(Keys, {
@@ -467,9 +464,6 @@ end
467464
{
468465
"neovim/nvim-lspconfig",
469466
opts = function()
470-
if LazyVim.pick.want() ~= "fzf" then
471-
return
472-
end
473467
local Keys = require("lazyvim.plugins.lsp.keymaps").get()
474468
-- stylua: ignore
475469
vim.list_extend(Keys, {

docs/extras/editor/neo-tree.md

Lines changed: 213 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,213 @@
1+
# `Neo-tree`
2+
3+
<!-- plugins:start -->
4+
5+
:::info
6+
You can enable the extra with the `:LazyExtras` command.
7+
Plugins marked as optional will only be configured if they are installed.
8+
:::
9+
10+
Below you can find a list of included plugins and their default settings.
11+
12+
:::caution
13+
You don't need to copy the default settings to your config.
14+
They are only shown here for reference.
15+
:::
16+
17+
import Tabs from '@theme/Tabs';
18+
import TabItem from '@theme/TabItem';
19+
20+
## [neo-tree.nvim](https://github.com/nvim-neo-tree/neo-tree.nvim)
21+
22+
file explorer
23+
24+
25+
<Tabs>
26+
27+
<TabItem value="opts" label="Options">
28+
29+
```lua
30+
opts = {
31+
sources = { "filesystem", "buffers", "git_status" },
32+
open_files_do_not_replace_types = { "terminal", "Trouble", "trouble", "qf", "Outline" },
33+
filesystem = {
34+
bind_to_cwd = false,
35+
follow_current_file = { enabled = true },
36+
use_libuv_file_watcher = true,
37+
},
38+
window = {
39+
mappings = {
40+
["l"] = "open",
41+
["h"] = "close_node",
42+
["<space>"] = "none",
43+
["Y"] = {
44+
function(state)
45+
local node = state.tree:get_node()
46+
local path = node:get_id()
47+
vim.fn.setreg("+", path, "c")
48+
end,
49+
desc = "Copy Path to Clipboard",
50+
},
51+
["O"] = {
52+
function(state)
53+
require("lazy.util").open(state.tree:get_node().path, { system = true })
54+
end,
55+
desc = "Open with System Application",
56+
},
57+
["P"] = { "toggle_preview", config = { use_float = false } },
58+
},
59+
},
60+
default_component_configs = {
61+
indent = {
62+
with_expanders = true, -- if nil and file nesting is enabled, will enable expanders
63+
expander_collapsed = "",
64+
expander_expanded = "",
65+
expander_highlight = "NeoTreeExpander",
66+
},
67+
git_status = {
68+
symbols = {
69+
unstaged = "󰄱",
70+
staged = "󰱒",
71+
},
72+
},
73+
},
74+
}
75+
```
76+
77+
</TabItem>
78+
79+
80+
<TabItem value="code" label="Full Spec">
81+
82+
```lua
83+
{
84+
"nvim-neo-tree/neo-tree.nvim",
85+
cmd = "Neotree",
86+
keys = {
87+
{
88+
"<leader>fe",
89+
function()
90+
require("neo-tree.command").execute({ toggle = true, dir = LazyVim.root() })
91+
end,
92+
desc = "Explorer NeoTree (Root Dir)",
93+
},
94+
{
95+
"<leader>fE",
96+
function()
97+
require("neo-tree.command").execute({ toggle = true, dir = vim.uv.cwd() })
98+
end,
99+
desc = "Explorer NeoTree (cwd)",
100+
},
101+
{ "<leader>e", "<leader>fe", desc = "Explorer NeoTree (Root Dir)", remap = true },
102+
{ "<leader>E", "<leader>fE", desc = "Explorer NeoTree (cwd)", remap = true },
103+
{
104+
"<leader>ge",
105+
function()
106+
require("neo-tree.command").execute({ source = "git_status", toggle = true })
107+
end,
108+
desc = "Git Explorer",
109+
},
110+
{
111+
"<leader>be",
112+
function()
113+
require("neo-tree.command").execute({ source = "buffers", toggle = true })
114+
end,
115+
desc = "Buffer Explorer",
116+
},
117+
},
118+
deactivate = function()
119+
vim.cmd([[Neotree close]])
120+
end,
121+
init = function()
122+
-- FIX: use `autocmd` for lazy-loading neo-tree instead of directly requiring it,
123+
-- because `cwd` is not set up properly.
124+
vim.api.nvim_create_autocmd("BufEnter", {
125+
group = vim.api.nvim_create_augroup("Neotree_start_directory", { clear = true }),
126+
desc = "Start Neo-tree with directory",
127+
once = true,
128+
callback = function()
129+
if package.loaded["neo-tree"] then
130+
return
131+
else
132+
local stats = vim.uv.fs_stat(vim.fn.argv(0))
133+
if stats and stats.type == "directory" then
134+
require("neo-tree")
135+
end
136+
end
137+
end,
138+
})
139+
end,
140+
opts = {
141+
sources = { "filesystem", "buffers", "git_status" },
142+
open_files_do_not_replace_types = { "terminal", "Trouble", "trouble", "qf", "Outline" },
143+
filesystem = {
144+
bind_to_cwd = false,
145+
follow_current_file = { enabled = true },
146+
use_libuv_file_watcher = true,
147+
},
148+
window = {
149+
mappings = {
150+
["l"] = "open",
151+
["h"] = "close_node",
152+
["<space>"] = "none",
153+
["Y"] = {
154+
function(state)
155+
local node = state.tree:get_node()
156+
local path = node:get_id()
157+
vim.fn.setreg("+", path, "c")
158+
end,
159+
desc = "Copy Path to Clipboard",
160+
},
161+
["O"] = {
162+
function(state)
163+
require("lazy.util").open(state.tree:get_node().path, { system = true })
164+
end,
165+
desc = "Open with System Application",
166+
},
167+
["P"] = { "toggle_preview", config = { use_float = false } },
168+
},
169+
},
170+
default_component_configs = {
171+
indent = {
172+
with_expanders = true, -- if nil and file nesting is enabled, will enable expanders
173+
expander_collapsed = "",
174+
expander_expanded = "",
175+
expander_highlight = "NeoTreeExpander",
176+
},
177+
git_status = {
178+
symbols = {
179+
unstaged = "󰄱",
180+
staged = "󰱒",
181+
},
182+
},
183+
},
184+
},
185+
config = function(_, opts)
186+
local function on_move(data)
187+
Snacks.rename.on_rename_file(data.source, data.destination)
188+
end
189+
190+
local events = require("neo-tree.events")
191+
opts.event_handlers = opts.event_handlers or {}
192+
vim.list_extend(opts.event_handlers, {
193+
{ event = events.FILE_MOVED, handler = on_move },
194+
{ event = events.FILE_RENAMED, handler = on_move },
195+
})
196+
require("neo-tree").setup(opts)
197+
vim.api.nvim_create_autocmd("TermClose", {
198+
pattern = "*lazygit",
199+
callback = function()
200+
if package.loaded["neo-tree.sources.git_status"] then
201+
require("neo-tree.sources.git_status").refresh()
202+
end
203+
end,
204+
})
205+
end,
206+
}
207+
```
208+
209+
</TabItem>
210+
211+
</Tabs>
212+
213+
<!-- plugins:end -->

docs/extras/editor/snacks_picker.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -229,9 +229,6 @@ end
229229

230230
```lua
231231
opts = function()
232-
if LazyVim.pick.want() ~= "snacks" then
233-
return
234-
end
235232
local Keys = require("lazyvim.plugins.lsp.keymaps").get()
236233
-- stylua: ignore
237234
vim.list_extend(Keys, {
@@ -254,9 +251,6 @@ end
254251
{
255252
"neovim/nvim-lspconfig",
256253
opts = function()
257-
if LazyVim.pick.want() ~= "snacks" then
258-
return
259-
end
260254
local Keys = require("lazyvim.plugins.lsp.keymaps").get()
261255
-- stylua: ignore
262256
vim.list_extend(Keys, {

0 commit comments

Comments
 (0)