From 966d12ac730c83da90d60ab24eae539b2ea69441 Mon Sep 17 00:00:00 2001 From: srdusr Date: Wed, 24 Sep 2025 00:14:04 +0200 Subject: Update/Overhaul --- lua/plugins/neoscroll.lua | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) mode change 100644 => 100755 lua/plugins/neoscroll.lua (limited to 'lua/plugins/neoscroll.lua') diff --git a/lua/plugins/neoscroll.lua b/lua/plugins/neoscroll.lua old mode 100644 new mode 100755 index d122584..f2ecb04 --- a/lua/plugins/neoscroll.lua +++ b/lua/plugins/neoscroll.lua @@ -1,21 +1,22 @@ -require("neoscroll").setup({ - easing_function = "quadratic", -}) +local M = {} -local t = {} --- Syntax: t[keys] = {function, {function arguments}} --- Use the "sine" easing function -t[""] = { "scroll", { "-vim.wo.scroll", "true", "20", [['cubic']] } } -t[""] = { "scroll", { "vim.wo.scroll", "true", "20", [['cubic']] } } --- Use the "circular" easing function -t[""] = { "scroll", { "-vim.api.nvim_win_get_height(0)", "true", "50", [['cubic']] } } -t[""] = { "scroll", { "vim.api.nvim_win_get_height(0)", "true", "50", [['cubic']] } } --- Pass "nil" to disable the easing animation (constant scrolling speed) -t[""] = { "scroll", { "-0.10", "false", "100", nil } } -t[""] = { "scroll", { "0.10", "false", "100", nil } } --- When no easing function is provided the default easing function (in this case "quadratic") will be used -t["zt"] = { "zt", { "10" } } -t["zz"] = { "zz", { "10" } } -t["zb"] = { "zb", { "10" } } +function M.setup() + local ok, neoscroll = pcall(require, 'neoscroll') + if not ok then + return false + end + + -- Basic configuration + neoscroll.setup({ + mappings = {'', '', '', '', '', '', 'zt', 'zz', 'zb'}, + hide_cursor = true, + stop_eof = true, + respect_scrolloff = false, + cursor_scrolls_alone = true, + easing_function = 'quadratic', + }) + + return true +end -require("neoscroll.config").set_mappings(t) +return M -- cgit v1.2.3