diff --git a/lua/lazyvim/plugins/extras/ui/mini-animate.lua b/lua/lazyvim/plugins/extras/ui/mini-animate.lua index c1f44d6d..e6e97cd8 100644 --- a/lua/lazyvim/plugins/extras/ui/mini-animate.lua +++ b/lua/lazyvim/plugins/extras/ui/mini-animate.lua @@ -18,6 +18,13 @@ return { return { resize = { timing = animate.gen_timing.linear({ duration = 50, unit = "total" }), + -- diable animate when resize acitve + -- best effort to avoid lagging when doing a lot of relative resizing + subresize = animate.gen_subresize.equal({ + predicate = function() + return not animate.is_active("resize") + end, + }), }, scroll = { timing = animate.gen_timing.linear({ duration = 150, unit = "total" }), @@ -33,4 +40,36 @@ return { }, } end, + -- because of "VeryLazy" event, "MiniAnimate" module has already been exported + -- make LazyVim key maps smoother + keys = { + { + "", + function() + MiniAnimate.execute_after("resize", "resize +2") + end, + desc = "Increase Window Height", + }, + { + "", + function() + MiniAnimate.execute_after("resize", "resize -2") + end, + desc = "Decrease Window Height", + }, + { + "", + function() + MiniAnimate.execute_after("resize", "vertical resize -2") + end, + desc = "Decrease Window Width", + }, + { + "", + function() + MiniAnimate.execute_after("resize", "vertical resize +2") + end, + desc = "Increase Window Width", + }, + }, }