psliwka / vim-smoothie

Smooth scrolling for Vim done rightšŸ„¤
MIT License
994 stars 27 forks source link

Center screen after scrolling #46

Open MinmoTech opened 1 year ago

MinmoTech commented 1 year ago

I would like to center the screen after scrolling (which I got from this video), but the following mapping does not work:

let g:smoothie_no_default_mappings = 1
nnoremap <unique> <C-d> <cmd>call smoothie#do("\<C-d>") <CR>zz
vnoremap <unique> <C-d> <cmd>call smoothie#do("\<C-d>") <CR>zz
nnoremap <unique> <C-u> <cmd>call smoothie#do("\<C-u>") <CR>zz
vnoremap <unique> <C-u> <cmd>call smoothie#do("\<C-u>") <CR>zz

I think it's because vim-smoothie's scrolling happens after the centering.

Is there a workaround/fix for this? :)

Thanks for any help already!