commit 0fdaafe3bd38bba988887b682aa888ad4c21d600
parent a6d0e96006ff9d108cfc103bdb5328484a2138b2
Author: Tomas Nemec <owl@gtms.dev>
Date: Tue, 3 Sep 2024 06:49:57 +0200
update
Diffstat:
1 file changed, 12 insertions(+), 11 deletions(-)
diff --git a/after/plugin/neoscroll.lua b/after/plugin/neoscroll.lua
@@ -2,16 +2,17 @@ if not pcall(require, 'neoscroll') then
return
end
-require 'neoscroll'.setup {
- mappings = { '<C-u>', '<C-d>', '<C-b>', '<C-f>', 'zt', 'zz', 'zb' },
+local neoscroll = require 'neoscroll'
+neoscroll.setup {
+ mappings = {},
+ hide_cursor = false,
}
-require 'neoscroll.config'.set_mappings {
- ['<C-u>'] = { 'scroll', { '-vim.wo.scroll', 'true', '80' } },
- ['<C-d>'] = { 'scroll', { 'vim.wo.scroll', 'true', '80' } },
- ['<C-b>'] = { 'scroll', { '-vim.api.nvim_win_get_height(0)', 'true', '100' } },
- ['<C-f>'] = { 'scroll', { 'vim.api.nvim_win_get_height(0)', 'true', '100' } },
- ['zt'] = { 'zt', { '100' } },
- ['zz'] = { 'zz', { '100' } },
- ['zb'] = { 'zb', { '100' } },
-}
+local modes = { 'n', 'v', 'x' }
+vim.keymap.set(modes, '<C-u>', function() neoscroll.ctrl_u { duration = 80 } end)
+vim.keymap.set(modes, '<C-d>', function() neoscroll.ctrl_d { duration = 80 } end)
+vim.keymap.set(modes, '<C-b>', function() neoscroll.ctrl_b { duration = 100 } end)
+vim.keymap.set(modes, '<C-f>', function() neoscroll.ctrl_f { duration = 100 } end)
+vim.keymap.set(modes, 'zt', function() neoscroll.zt { half_win_duration = 100 } end)
+vim.keymap.set(modes, 'zz', function() neoscroll.zz { half_win_duration = 100 } end)
+vim.keymap.set(modes, 'zb', function() neoscroll.zb { half_win_duration = 100 } end)