From dd62c1c26ef480bb58a13de971e8418ec7181010 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20La=C3=ADn?= Date: Wed, 26 Jun 2024 12:06:34 +0200 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20refactor(nvim):=20smooth-s?= =?UTF-8?q?crolling=20extra?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plugins/extras/ui/smooth-scrolling.lua | 27 ++++++++++++++----- 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/.config/nvim/lua/plugins/extras/ui/smooth-scrolling.lua b/.config/nvim/lua/plugins/extras/ui/smooth-scrolling.lua index b08aa5ba..54529e40 100644 --- a/.config/nvim/lua/plugins/extras/ui/smooth-scrolling.lua +++ b/.config/nvim/lua/plugins/extras/ui/smooth-scrolling.lua @@ -1,10 +1,25 @@ return { "declancm/cinnamon.nvim", event = "VeryLazy", - opts = { - default_keymaps = true, - extra_keymaps = false, - extended_keymaps = false, - default_delay = 2, - }, + config = function() + require("cinnamon").setup({ + keymaps = { extra = true }, + options = { delay = 5 }, + }) + + local keymaps = { + [""] = "zz", + [""] = "zz", + ["n"] = "nzzzv", + ["N"] = "Nzzzv", + } + + local scroll = require("cinnamon").scroll + + for key, value in pairs(keymaps) do + vim.keymap.set("n", key, function() + scroll(value) + end) + end + end, }