Files
neovim-config/archive/mini-animate.lua
T
rootiest c0a3511384 🧙 Major Restructuring Update
- Plugins are now properly organized into separate folders.
- General configurations are also now organized by category into
folders.
- Now using lazyvim-defined plugins whenever possible for a more
consistent and clean experience.
- Duplicate manual plugin definitions were removed.
- Extensive testing has been performed to ensure config works on fresh
installs and a variety of systems.
- Further slimming of manual plugins and an updated dependency list is
forthcoming.
2024-07-08 10:17:08 -04:00

47 lines
1.3 KiB
Lua

-- -----------------------------------------------------------------------------
-- ------------------------------ mini-animate ---------------------------------
-- -----------------------------------------------------------------------------
return {
"echasnovski/mini.animate",
recommended = true,
event = "VeryLazy",
opts = function()
-- don't use animate when scrolling with the mouse
local mouse_scrolled = false
for _, scroll in ipairs({ "Up", "Down" }) do
local key = "<ScrollWheel" .. scroll .. ">"
vim.keymap.set({ "", "i" }, key, function()
mouse_scrolled = true
return key
end, { expr = true })
end
local animate = require("mini.animate")
return {
resize = {
timing = animate.gen_timing.linear({
duration = 50,
unit = "total",
}),
},
scroll = {
timing = animate.gen_timing.linear({
duration = 150,
unit = "total",
}),
subscroll = animate.gen_subscroll.equal({
predicate = function(total_scroll)
if mouse_scrolled then
mouse_scrolled = false
return false
end
return total_scroll > 1
end,
}),
},
}
end,
cond = function() -- Not Using SSH or root
return not vim.g.neovide
end,
}