@@ -106,6 +106,76 @@ return {
106106 end ,
107107 },
108108
109+ -- ========================================================================
110+ -- SMOOTH SCROLLING & ANIMATIONS - mini.animate
111+ -- ========================================================================
112+ -- Provides smooth scrolling and cursor animations for a better visual experience.
113+ --
114+ -- Features:
115+ -- - Smooth scrolling (when using Ctrl+D, Ctrl+U, etc.)
116+ -- - Cursor path animation when jumping
117+ -- - Window resize animations
118+ -- - Window open/close animations
119+ --
120+ -- All animations are non-blocking and can be customized or disabled independently.
121+ -- ========================================================================
122+ {
123+ ' echasnovski/mini.animate' ,
124+ event = ' VeryLazy' , -- Load after UI is ready
125+ opts = function ()
126+ -- Don't use animate when scrolling with the mouse
127+ local mouse_scrolled = false
128+ for _ , scroll in ipairs ({ ' Up' , ' Down' }) do
129+ local key = ' <ScrollWheel' .. scroll .. ' >'
130+ vim .keymap .set ({ ' ' , ' i' }, key , function ()
131+ mouse_scrolled = true
132+ return key
133+ end , { expr = true })
134+ end
135+
136+ local animate = require (' mini.animate' )
137+ return {
138+ -- Cursor path animation - shows path when cursor jumps
139+ cursor = {
140+ enable = true ,
141+ timing = animate .gen_timing .linear ({ duration = 100 , unit = ' total' }),
142+ },
143+
144+ -- Smooth scrolling
145+ scroll = {
146+ enable = true ,
147+ timing = animate .gen_timing .linear ({ duration = 150 , unit = ' total' }),
148+ subscroll = animate .gen_subscroll .equal ({
149+ predicate = function (total_scroll )
150+ if mouse_scrolled then
151+ mouse_scrolled = false
152+ return false
153+ end
154+ return total_scroll > 1
155+ end ,
156+ }),
157+ },
158+
159+ -- Window resize animation
160+ resize = {
161+ enable = true ,
162+ timing = animate .gen_timing .linear ({ duration = 50 , unit = ' total' }),
163+ },
164+
165+ -- Window open/close animation
166+ open = {
167+ enable = false , -- Disabled by default as it can be distracting
168+ timing = animate .gen_timing .linear ({ duration = 150 , unit = ' total' }),
169+ },
170+
171+ close = {
172+ enable = false , -- Disabled by default
173+ timing = animate .gen_timing .linear ({ duration = 150 , unit = ' total' }),
174+ },
175+ }
176+ end ,
177+ },
178+
109179 -- ========================================================================
110180 -- ADDITIONAL COMMON PLUGINS
111181 -- ========================================================================
0 commit comments