docs: docgen

This commit is contained in:
Folke Lemaitre 2024-12-10 13:37:30 +01:00
parent 614df63acf
commit 98782f9fa3
13 changed files with 91 additions and 3 deletions

View file

@ -10,6 +10,14 @@ Table of Contents *snacks-animate-table-of-contents*
- Snacks.animate() |snacks-animate-module-snacks.animate()|
- Snacks.animate.add() |snacks-animate-module-snacks.animate.add()|
- Snacks.animate.del() |snacks-animate-module-snacks.animate.del()|
Efficient animation library including over 45 easing functions:
- Emmanuel Ogas easing functions <https://github.com/EmmanuelOga/easing>
- Easing functions overview <https://github.com/kikito/tween.lua?tab=readme-ov-file#easing-functions>
Theres at any given time at most one timer running, that takes care of all
active animations, controlled by the `fps` setting.
==============================================================================
1. Setup *snacks-animate-setup*

View file

@ -11,6 +11,14 @@ Table of Contents *snacks-dim-table-of-contents*
- Snacks.dim.disable() |snacks-dim-module-snacks.dim.disable()|
- Snacks.dim.enable() |snacks-dim-module-snacks.dim.enable()|
- Snacks.dim.on_win() |snacks-dim-module-snacks.dim.on_win()|
Focus on the active scope by dimming the rest.
Similar plugins:
- twilight.nvim <https://github.com/folke/twilight.nvim>
- limelight.vim <https://github.com/junegunn/limelight.vim>
- goyo.vim <https://github.com/junegunn/goyo.vim>
==============================================================================
1. Setup *snacks-dim-setup*
@ -75,7 +83,7 @@ Table of Contents *snacks-dim-table-of-contents*
`Snacks.dim.animate()` *Snacks.dim.animate()*
Animate scope changes
Toggle scope animations
>lua
Snacks.dim.animate()

View file

@ -14,6 +14,13 @@ Table of Contents *snacks-indent-table-of-contents*
- Snacks.indent.on_scope() |snacks-indent-module-snacks.indent.on_scope()|
- Snacks.indent.on_win() |snacks-indent-module-snacks.indent.on_win()|
- Snacks.indent.render() |snacks-indent-module-snacks.indent.render()|
Visualize indent guides and scopes based on treesitter or indent.
Similar plugins:
- indent-blankline.nvim <https://github.com/lukas-reineke/indent-blankline.nvim>
- mini.indentscope <https://github.com/echasnovski/mini.indentscope>
==============================================================================
1. Setup *snacks-indent-setup*

View file

@ -9,6 +9,11 @@ Table of Contents *snacks-scope-table-of-contents*
4. Module |snacks-scope-module|
- Snacks.scope.attach() |snacks-scope-module-snacks.scope.attach()|
- Snacks.scope.get() |snacks-scope-module-snacks.scope.get()|
Scope detection based on treesitter or indent.
The indent-based algorithm is similar to what is used in mini.indentscope
<https://github.com/echasnovski/mini.indentscope>.
==============================================================================
1. Setup *snacks-scope-setup*

View file

@ -9,6 +9,13 @@ Table of Contents *snacks-scroll-table-of-contents*
4. Module |snacks-scroll-module|
- Snacks.scroll.disable() |snacks-scroll-module-snacks.scroll.disable()|
- Snacks.scroll.enable() |snacks-scroll-module-snacks.scroll.enable()|
Smooth scrolling for Neovim. Properly handles `scrolloff` and mouse scrolling.
Similar plugins:
- mini.animate <https://github.com/echasnovski/mini.animate>
- neoscroll.nvim <https://github.com/karb94/neoscroll.nvim>
==============================================================================
1. Setup *snacks-scroll-setup*

View file

@ -12,6 +12,14 @@ Table of Contents *snacks-zen-table-of-contents*
- Snacks.zen() |snacks-zen-module-snacks.zen()|
- Snacks.zen.zen() |snacks-zen-module-snacks.zen.zen()|
- Snacks.zen.zoom() |snacks-zen-module-snacks.zen.zoom()|
Zen mode • distraction-free coding. Integrates with `Snacks.toggle` to toggle
various UI elements and with `Snacks.dim` to dim code out of scope.
Similar plugins:
- zen-mode.nvim <https://github.com/folke/zen-mode.nvim>
- true-zen.nvim <https://github.com/pocco81/true-zen.nvim>
==============================================================================
1. Setup *snacks-zen-setup*

View file

@ -1,5 +1,13 @@
# 🍿 animate
Efficient animation library including over 45 easing functions:
- [Emmanuel Oga's easing functions](https://github.com/EmmanuelOga/easing)
- [Easing functions overview](https://github.com/kikito/tween.lua?tab=readme-ov-file#easing-functions)
There's at any given time at most one timer running, that takes
care of all active animations, controlled by the `fps` setting.
<!-- docgen -->
## 📦 Setup

View file

@ -1,5 +1,13 @@
# 🍿 dim
Focus on the active scope by dimming the rest.
Similar plugins:
- [twilight.nvim](https://github.com/folke/twilight.nvim)
- [limelight.vim](https://github.com/junegunn/limelight.vim)
- [goyo.vim](https://github.com/junegunn/goyo.vim)
<!-- docgen -->
## 📦 Setup
@ -58,7 +66,7 @@ Snacks.dim()
### `Snacks.dim.animate()`
Animate scope changes
Toggle scope animations
```lua
Snacks.dim.animate()

View file

@ -1,5 +1,12 @@
# 🍿 indent
Visualize indent guides and scopes based on treesitter or indent.
Similar plugins:
- [indent-blankline.nvim](https://github.com/lukas-reineke/indent-blankline.nvim)
- [mini.indentscope](https://github.com/echasnovski/mini.indentscope)
<!-- docgen -->
## 📦 Setup

View file

@ -1,5 +1,10 @@
# 🍿 scope
Scope detection based on treesitter or indent.
The indent-based algorithm is similar to what is used
in [mini.indentscope](https://github.com/echasnovski/mini.indentscope).
<!-- docgen -->
## 📦 Setup

View file

@ -1,5 +1,13 @@
# 🍿 scroll
Smooth scrolling for Neovim.
Properly handles `scrolloff` and mouse scrolling.
Similar plugins:
- [mini.animate](https://github.com/echasnovski/mini.animate)
- [neoscroll.nvim](https://github.com/karb94/neoscroll.nvim)
<!-- docgen -->
## 📦 Setup

View file

@ -1,5 +1,14 @@
# 🍿 zen
Zen mode • distraction-free coding.
Integrates with `Snacks.toggle` to toggle various UI elements
and with `Snacks.dim` to dim code out of scope.
Similar plugins:
- [zen-mode.nvim](https://github.com/folke/zen-mode.nvim)
- [true-zen.nvim](https://github.com/pocco81/true-zen.nvim)
<!-- docgen -->
## 📦 Setup

View file

@ -138,7 +138,7 @@ function M.disable()
vim.cmd([[redraw!]])
end
-- Animate scope changes
-- Toggle scope animations
function M.animate()
M.animating = not M.animating
end