Skip to content

Commit

Permalink
docs: docgen
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Nov 8, 2024
1 parent d079fbf commit 42e3a25
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 3 deletions.
25 changes: 23 additions & 2 deletions doc/snacks-rename.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ Table of Contents *snacks-rename-table-of-contents*
1. Usage |snacks-rename-usage|
2. mini.files |snacks-rename-mini.files|
3. neo-tree.nvim |snacks-rename-neo-tree.nvim|
4. Module |snacks-rename-module|
4. nvim-tree |snacks-rename-nvim-tree|
5. Module |snacks-rename-module|
- Snacks.rename.on_rename_file()|snacks-rename-module-snacks.rename.on_rename_file()|
- Snacks.rename.rename_file()|snacks-rename-module-snacks.rename.rename_file()|
LSP-integrated file renaming with support for plugins like neo-tree.nvim
Expand Down Expand Up @@ -53,7 +54,27 @@ LSP-integrated file renaming with support for plugins like neo-tree.nvim


==============================================================================
4. Module *snacks-rename-module*
4. nvim-tree *snacks-rename-nvim-tree*

>lua
local prev = { new_name = "", old_name = "" } -- Prevents duplicate events
vim.api.nvim_create_autocmd("User", {
pattern = "NvimTreeSetup",
callback = function()
local events = require("nvim-tree.api").events
events.subscribe(events.Event.NodeRenamed, function(data)
if prev.new_name ~= data.new_name or prev.old_name ~= data.old_name then
data = data
Snacks.rename.on_rename_file(data.old_name, data.new_name)
end
end)
end,
})
<


==============================================================================
5. Module *snacks-rename-module*


SNACKS.RENAME.ON_RENAME_FILE()*snacks-rename-module-snacks.rename.on_rename_file()*
Expand Down
11 changes: 10 additions & 1 deletion doc/snacks-words.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Table of Contents *snacks-words-table-of-contents*

1. Config |snacks-words-config|
2. Module |snacks-words-module|
- Snacks.words.clear() |snacks-words-module-snacks.words.clear()|
- Snacks.words.is_enabled() |snacks-words-module-snacks.words.is_enabled()|
- Snacks.words.jump() |snacks-words-module-snacks.words.jump()|
Auto-show LSP references and quickly navigate between them
Expand All @@ -18,8 +19,9 @@ Auto-show LSP references and quickly navigate between them
{
enabled = true, -- enable/disable the plugin
debounce = 200, -- time in ms to wait before updating
notify_jump = true, -- show a notification when jumping
notify_jump = false, -- show a notification when jumping
notify_end = true, -- show a notification when reaching the end
modes = { "n", "i", "c" }, -- modes to show references
}
<

Expand All @@ -28,6 +30,13 @@ Auto-show LSP references and quickly navigate between them
2. Module *snacks-words-module*


SNACKS.WORDS.CLEAR() *snacks-words-module-snacks.words.clear()*

>lua
Snacks.words.clear()
<


SNACKS.WORDS.IS_ENABLED() *snacks-words-module-snacks.words.is_enabled()*

>lua
Expand Down
7 changes: 7 additions & 0 deletions docs/words.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,18 @@ Auto-show LSP references and quickly navigate between them
debounce = 200, -- time in ms to wait before updating
notify_jump = false, -- show a notification when jumping
notify_end = true, -- show a notification when reaching the end
modes = { "n", "i", "c" }, -- modes to show references
}
```

## 📦 Module

### `Snacks.words.clear()`

```lua
Snacks.words.clear()
```

### `Snacks.words.is_enabled()`

```lua
Expand Down

0 comments on commit 42e3a25

Please sign in to comment.