Skip to content

Help using zz after scroll with mini.animate #1436

Closed Answered by echasnovski
diego-velez asked this question in Q&A
Discussion options

You must be logged in to vote

The first keymap is not working, but the others are.

This is because it executes vim.cmd("exe "normal! \\<C-d>"") which both not syntactically correct and (probably) won't work with \\<C-d> as the argument to normal!. Use '<Cmd>lua vim.cmd("normal! \4"); ' (\4 is the "true" termcode/keycode for <C-d>) as the first part of the mapping's RHS.

But I'd say that any centering after scroll will have limited support, unfortunately. Mostly due to the fact that scroll is done with side effects (basically, what is said here) and the "general" nature of how scrolling is implemented.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by diego-velez
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
2 participants