Skip to content

Commit

Permalink
chore(docs): auto-generate vimdoc
Browse files Browse the repository at this point in the history
  • Loading branch information
declancm committed Jul 13, 2024
1 parent 267f957 commit 1f86582
Showing 1 changed file with 34 additions and 16 deletions.
50 changes: 34 additions & 16 deletions doc/cinnamon.nvim.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,17 @@ Table of Contents *cinnamon.nvim-table-of-contents*
- Keymaps |cinnamon.nvim-keymaps|
- API |cinnamon.nvim-api|
- User Events |cinnamon.nvim-user-events|
- Disabling |cinnamon.nvim-disabling|

FEATURES *cinnamon.nvim-features*

- Can add smooth scrolling to any normal mode movement, command, or Lua function
- Can add smooth cursor and window scroll animation to any normal mode movement, command, or Lua function
- Horizontal, vertical, and diagonal scrolling
- Adjusts scroll speed based on movement distance
- Non-blocking delays using luv
- Two scrolling modes:
- `cursor`Smoothly scrolls the cursor for any movement
- `window`Smoothly scrolls the window ONLY when the cursor moves out of view
- `cursor`animate cursor and window scrolling for any movement
- `window`animate window scrolling ONLY when the cursor moves out of view


REQUIREMENTS *cinnamon.nvim-requirements*
Expand Down Expand Up @@ -70,24 +71,24 @@ DEFAULT OPTIONS ~
-- Delay between each movement step (in ms)
delay = 5,
step_size = {
-- Default number of cursor/window lines moved per step
-- Number of cursor/window lines moved per step
vertical = 1,
-- Default number of cursor/window columns moved per step
-- Number of cursor/window columns moved per step
horizontal = 2,
},
max_delta = {
-- Maximum distance for line movements before smooth
-- scrolling is skipped. Set to `false` to disable
-- Maximum distance for line movements before scroll
-- animation is skipped. Set to `false` to disable
line = false,
-- Maximum distance for column movements before smooth
-- scrolling is skipped. Set to `false` to disable
-- Maximum distance for column movements before scroll
-- animation is skipped. Set to `false` to disable
column = false,
-- Maximum duration for a movement (in ms). Automatically scales the delay and step size
time = 1000,
},
-- The scrolling mode
-- `cursor`: Smoothly scrolls the cursor for any movement
-- `window`: Smoothly scrolls the window ONLY when the cursor moves out of view
-- `cursor`: animate cursor and window scrolling for any movement
-- `window`: animate window scrolling ONLY when the cursor moves out of view
mode = "cursor",
},
}
Expand All @@ -114,7 +115,7 @@ KEYMAPS *cinnamon.nvim-keymaps*

BASIC KEYMAPS ~

**Smooth scrolling for …**
**Scroll animation for …**

-----------------------------------------------------------------------
Category Keys
Expand All @@ -133,7 +134,7 @@ BASIC KEYMAPS ~

EXTRA KEYMAPS ~

**Smooth scrolling for …**
**Scroll animation for …**

-----------------------------------------------------------------------
Category Keys
Expand Down Expand Up @@ -165,6 +166,8 @@ DESCRIPTION ~

`require("cinnamon").scroll({command}, {options})`

Executes the given command with cursor and window scroll animation.

- `{command}` **(string|function)** Can be any of the following:
- Normal mode movement command
>lua
Expand Down Expand Up @@ -192,7 +195,6 @@ EXAMPLES ~
>lua
local cinnamon = require("cinnamon")

-- Setup the plugin with default options
cinnamon.setup()

-- Centered scrolling:
Expand Down Expand Up @@ -222,8 +224,24 @@ USER EVENTS *cinnamon.nvim-user-events*

- `CinnamonCmdPre` - Triggered before the given command is executed
- `CinnamonCmdPost` - Triggered after the given command is executed
- `CinnamonScrollPre` - Triggered before the smooth scroll movement
- `CinnamonScrollPost` - Triggered after the smooth scroll movement
- `CinnamonScrollPre` - Triggered before the scroll animation
- `CinnamonScrollPost` - Triggered after the scroll animation


DISABLING *cinnamon.nvim-disabling*

- `vim.b.cinnamon_disable` **(boolean)** Disable scroll animation for the current buffer
- `vim.g.cinnamon_disable` **(boolean)** Disable scroll animation globally

Example Usage:

>lua
-- Disable scrolling for help buffers
vim.api.nvim_create_autocmd("FileType", {
pattern = "help",
callback = function() vim.b.cinnamon_disable = true end,
})
<

Generated by panvimdoc <https://github.com/kdheepak/panvimdoc>

Expand Down

0 comments on commit 1f86582

Please sign in to comment.