added nvim
This commit is contained in:
parent
02fe17d9a1
commit
975099489a
34 changed files with 1523 additions and 0 deletions
52
.config/nvim/lua/plugins/extend-mini-animate.lua.bak
Normal file
52
.config/nvim/lua/plugins/extend-mini-animate.lua.bak
Normal file
|
@ -0,0 +1,52 @@
|
|||
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
|
||||
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = "grug-far",
|
||||
callback = function()
|
||||
vim.b.minianimate_disable = true
|
||||
end,
|
||||
})
|
||||
|
||||
LazyVim.toggle.map("<leader>ua", {
|
||||
name = "Mini Animate",
|
||||
get = function()
|
||||
return not vim.g.minianimate_disable
|
||||
end,
|
||||
set = function(state)
|
||||
vim.g.minianimate_disable = not state
|
||||
end,
|
||||
})
|
||||
|
||||
local animate = require("mini.animate")
|
||||
return {
|
||||
resize = {
|
||||
timing = animate.gen_timing.linear({ duration = 50, unit = "total" }),
|
||||
},
|
||||
scroll = {
|
||||
timing = animate.gen_timing.linear({ duration = 50, 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,
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue