From 429d465ba51565082ca1f25a196e149e62da1385 Mon Sep 17 00:00:00 2001 From: Andrzej Stepien Date: Mon, 18 Mar 2024 22:31:38 +0100 Subject: [PATCH] add smooth scrolling --- lazy-lock.json | 1 + lua/plugins/neoscroll.lua | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 lua/plugins/neoscroll.lua diff --git a/lazy-lock.json b/lazy-lock.json index a98c9b6..9b6a677 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -18,6 +18,7 @@ "mini.nvim": { "branch": "main", "commit": "9968f6e221ae7bdac57a910c5bf2026186aa023c" }, "neo-tree.nvim": { "branch": "v3.x", "commit": "742db4e60c74e5fbcc596aaf9e7575e1342dfd09" }, "neodev.nvim": { "branch": "main", "commit": "84e0290f5600e8b89c0dfcafc864f45496a53400" }, + "neoscroll.nvim": { "branch": "master", "commit": "21d52973bde32db998fc8b6590f87eb3c3c6d8e4" }, "nightfox.nvim": { "branch": "main", "commit": "a4eb88b2dad3fba5c2d87f82cd15dfb9de73913d" }, "nui.nvim": { "branch": "main", "commit": "cbd2668414331c10039278f558630ed19b93e69b" }, "nvim-cmp": { "branch": "main", "commit": "04e0ca376d6abdbfc8b52180f8ea236cbfddf782" }, diff --git a/lua/plugins/neoscroll.lua b/lua/plugins/neoscroll.lua new file mode 100644 index 0000000..edb1da8 --- /dev/null +++ b/lua/plugins/neoscroll.lua @@ -0,0 +1,17 @@ +return { + "karb94/neoscroll.nvim", + config = function() + require("neoscroll").setup({ + -- All these keys will be mapped to their corresponding default scrolling animation + mappings = { "", "", "", "", "", "", "zt", "zz", "zb" }, + hide_cursor = true, -- Hide cursor while scrolling + stop_eof = true, -- Stop at when scrolling downwards + respect_scrolloff = false, -- Stop scrolling when the cursor reaches the scrolloff margin of the file + cursor_scrolls_alone = true, -- The cursor will keep on scrolling even if the window cannot scroll further + easing_function = nil, -- Default easing function + pre_hook = nil, -- Function to run before the scrolling animation starts + post_hook = nil, -- Function to run after the scrolling animation ends + performance_mode = false, -- Disable "Performance Mode" on all buffers. + }) + end, +}