docs: docgen

This commit is contained in:
Folke Lemaitre 2024-11-06 13:08:08 +01:00
parent dd97a2a659
commit 36e2d192c3
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040
3 changed files with 69 additions and 35 deletions

View file

@ -7,23 +7,23 @@ A collection of small QoL plugins for Neovim.
## ✨ Features
| Snack | Description | Setup |
| ----------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ | :---: |
| [bigfile](https://github.com/folke/snacks.nvim/blob/main/docs/bigfile.md) | Deal with big files | ‼️ |
| [bufdelete](https://github.com/folke/snacks.nvim/blob/main/docs/bufdelete.md) | Delete buffers without disrupting window layout | |
| [debug](https://github.com/folke/snacks.nvim/blob/main/docs/debug.md) | Pretty inspect & backtraces for debugging | |
| [git](https://github.com/folke/snacks.nvim/blob/main/docs/git.md) | Useful functions for Git | |
| [gitbrowse](https://github.com/folke/snacks.nvim/blob/main/docs/gitbrowse.md) | Open the repo of the active file in the browser (e.g., GitHub) | |
| [lazygit](https://github.com/folke/snacks.nvim/blob/main/docs/lazygit.md) | Open LazyGit in a float, auto-configure colorscheme and integration with Neovim | |
| [notify](https://github.com/folke/snacks.nvim/blob/main/docs/notify.md) | Utility functions to work with Neovim's `vim.notify` | |
| [notifier](https://github.com/folke/snacks.nvim/blob/main/docs/notifier.md) | Better and prettier `vim.notify` | ‼️ |
| [quickfile](https://github.com/folke/snacks.nvim/blob/main/docs/quickfile.md) | When doing `nvim somefile.txt`, it will render the file as quickly as possible, before loading your plugins. | ‼️ |
| [rename](https://github.com/folke/snacks.nvim/blob/main/docs/rename.md) | LSP-integrated file renaming with support for plugins like neo-tree, nvim-tree, oil, mini.files | |
| [statuscolumn](https://github.com/folke/snacks.nvim/blob/main/docs/statuscolumn.md) | Pretty statuscolumn | ‼️ |
| [terminal](https://github.com/folke/snacks.nvim/blob/main/docs/terminal.md) | Create and toggle floating/split terminals | |
| [toggle](https://github.com/folke/snacks.nvim/blob/main/docs/toggle.md) | Toggle keymaps integrated with which-key icons / colors | |
| [win](https://github.com/folke/snacks.nvim/blob/main/docs/win.md) | Easily create and manage floating windows or splits | |
| [words](https://github.com/folke/snacks.nvim/blob/main/docs/words.md) | Auto-show LSP references and quickly navigate between them | ‼️ |
| Snack | Description | Setup |
| ----------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :---: |
| [bigfile](https://github.com/folke/snacks.nvim/blob/main/docs/bigfile.md) | Deal with big files | ‼️ |
| [bufdelete](https://github.com/folke/snacks.nvim/blob/main/docs/bufdelete.md) | Delete buffers without disrupting window layout | |
| [debug](https://github.com/folke/snacks.nvim/blob/main/docs/debug.md) | Pretty inspect & backtraces for debugging | |
| [git](https://github.com/folke/snacks.nvim/blob/main/docs/git.md) | Useful functions for Git | |
| [gitbrowse](https://github.com/folke/snacks.nvim/blob/main/docs/gitbrowse.md) | Open the repo of the active file in the browser (e.g., GitHub) | |
| [lazygit](https://github.com/folke/snacks.nvim/blob/main/docs/lazygit.md) | Open LazyGit in a float, auto-configure colorscheme and integration with Neovim | |
| [notify](https://github.com/folke/snacks.nvim/blob/main/docs/notify.md) | Utility functions to work with Neovim's `vim.notify` | |
| [notifier](https://github.com/folke/snacks.nvim/blob/main/docs/notifier.md) | Better and prettier `vim.notify` | ‼️ |
| [quickfile](https://github.com/folke/snacks.nvim/blob/main/docs/quickfile.md) | When doing `nvim somefile.txt`, it will render the file as quickly as possible, before loading your plugins. | ‼️ |
| [rename](https://github.com/folke/snacks.nvim/blob/main/docs/rename.md) | LSP-integrated file renaming with support for plugins like [neo-tree.nvim](https://github.com/nvim-neo-tree/neo-tree.nvim) and [mini.files](https://github.com/echasnovski/mini.files). | |
| [statuscolumn](https://github.com/folke/snacks.nvim/blob/main/docs/statuscolumn.md) | Pretty statuscolumn | ‼️ |
| [terminal](https://github.com/folke/snacks.nvim/blob/main/docs/terminal.md) | Create and toggle floating/split terminals | |
| [toggle](https://github.com/folke/snacks.nvim/blob/main/docs/toggle.md) | Toggle keymaps integrated with which-key icons / colors | |
| [win](https://github.com/folke/snacks.nvim/blob/main/docs/win.md) | Easily create and manage floating windows or splits | |
| [words](https://github.com/folke/snacks.nvim/blob/main/docs/words.md) | Auto-show LSP references and quickly navigate between them | ‼️ |
## ⚡️ Requirements

View file

@ -3,13 +3,57 @@
==============================================================================
Table of Contents *snacks-rename-table-of-contents*
1. Module |snacks-rename-module|
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|
- Snacks.rename.on_rename_file()|snacks-rename-module-snacks.rename.on_rename_file()|
- Snacks.rename.realpath() |snacks-rename-module-snacks.rename.realpath()|
- Snacks.rename.rename_file()|snacks-rename-module-snacks.rename.rename_file()|
LSP-integrated file renaming with support for plugins like neo-tree.nvim
<https://github.com/nvim-neo-tree/neo-tree.nvim> and mini.files
<https://github.com/echasnovski/mini.files>.
==============================================================================
1. Module *snacks-rename-module*
1. Usage *snacks-rename-usage*
==============================================================================
2. mini.files *snacks-rename-mini.files*
>lua
vim.api.nvim_create_autocmd("User", {
pattern = "MiniFilesActionRename",
callback = function(event)
Snacks.rename.on_rename_file(event.data.from, event.data.to)
end,
})
<
==============================================================================
3. neo-tree.nvim *snacks-rename-neo-tree.nvim*
>lua
{
"nvim-neo-tree/neo-tree.nvim",
opts = function(_, opts)
local function on_move(data)
Snacks.rename.on_rename_file(data.source, data.destination)
end
local events = require("neo-tree.events")
opts.event_handlers = opts.event_handlers or {}
vim.list_extend(opts.event_handlers, {
{ event = events.FILE_MOVED, handler = on_move },
{ event = events.FILE_RENAMED, handler = on_move },
})
end,
}
<
==============================================================================
4. Module *snacks-rename-module*
SNACKS.RENAME.ON_RENAME_FILE()*snacks-rename-module-snacks.rename.on_rename_file()*
@ -22,16 +66,10 @@ SNACKS.RENAME.ON_RENAME_FILE()*snacks-rename-module-snacks.rename.on_rename_file
<
SNACKS.RENAME.REALPATH() *snacks-rename-module-snacks.rename.realpath()*
>lua
---@param path string
Snacks.rename.realpath(path)
<
SNACKS.RENAME.RENAME_FILE() *snacks-rename-module-snacks.rename.rename_file()*
Prompt for the new filename, do the rename, and trigger LSP handlers
>lua
Snacks.rename.rename_file()
<

View file

@ -48,15 +48,11 @@ vim.api.nvim_create_autocmd("User", {
Snacks.rename.on_rename_file(from, to, rename)
```
### `Snacks.rename.realpath()`
```lua
---@param path string
Snacks.rename.realpath(path)
```
### `Snacks.rename.rename_file()`
Prompt for the new filename,
do the rename, and trigger LSP handlers
```lua
Snacks.rename.rename_file()
```