mirror of
https://github.com/pojokcodeid/nvim-lazy.git
synced 2025-06-21 08:35:48 +02:00
add: miniaimate
This commit is contained in:
parent
e50fb19878
commit
72ff763f68
15 changed files with 897 additions and 607 deletions
41
lua/plugins/mini-animate.lua
Normal file
41
lua/plugins/mini-animate.lua
Normal file
|
@ -0,0 +1,41 @@
|
|||
return {
|
||||
-- animations
|
||||
{
|
||||
"echasnovski/mini.animate",
|
||||
event = "BufRead",
|
||||
enabled = not vim.g.neovide and vim.g.pvode_minianimate and true or false,
|
||||
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 = 100, 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,
|
||||
config = function(_, opts)
|
||||
require("mini.animate").setup(opts)
|
||||
end,
|
||||
},
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue