
## Description I'm considering to replace [nvim-spectre](https://github.com/nvim-pack/nvim-spectre) with [grug-far.nvim](https://github.com/MagicDuck/grug-far.nvim). It has a better ui and I like the workflow better. I won't merge this right away. I'm mostly looking for feedback on whether this would be a good thing and whether the defaults option I've added seem ok. ## Related Issue(s) <!-- If this PR fixes any issues, please link to the issue here. - Fixes #<issue_number> --> ## Screenshots  ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines.
54 lines
1.4 KiB
Lua
54 lines
1.4 KiB
Lua
-- animations
|
|
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 = 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,
|
|
}
|