Skip to content

Commit

Permalink
fix: neoscroll keymap using new non-depricated syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
mutewinter committed Sep 11, 2024
1 parent dbea221 commit 3f90025
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions plug_plugins/neoscroll.vim
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,15 @@ endif


lua << EOF
require('neoscroll').setup()
local t = {}
t['<up>'] = {'scroll', {'-vim.wo.scroll', 'true', '200'}}
t['<down>'] = {'scroll', { 'vim.wo.scroll', 'true', '200'}}
require('neoscroll.config').set_mappings(t)
neoscroll = require('neoscroll')
neoscroll.setup()

local keymap = {
["<up>"] = function() neoscroll.scroll(-vim.wo.scroll, { move_cursor=true, duration = 200 }) end;
["<down>"] = function() neoscroll.scroll(vim.wo.scroll, { move_cursor=true, duration = 200 }) end;
}
local modes = { 'n', 'v', 'x' }
for key, func in pairs(keymap) do
vim.keymap.set(modes, key, func)
end
EOF

0 comments on commit 3f90025

Please sign in to comment.