Support Ukraine 🇺🇦Help Ukrainian ArmyHumanitarian Assistance to Ukrainians

Scrolling with Ctrl+E and Ctrl+Y is slow in VSCode Vim

Vim Fan

Jan 20 2020 at 20:46 GMT

I use the Vim extension for VSCode, and when I try to scroll down by pressing Ctrl+E and then to scroll up by pressing Ctrl+Y, VSCode gets very slow, completing the scroll with a delay that is in the order of seconds.

Is there any way to fix this?

1 Answer

john

Jan 20 2020 at 21:04 GMT

The way I sort of "fixed" this is by setting vim.scroll (used for Ctrl+D and Ctrl+U) to 1, and then rebinding Ctrl+E to Ctrl+D and Ctrl+Y to Ctrl+U by adding the following in VSCode's settings.json:

"vim.normalModeKeyBindings": [
    {
        "before": ["<C-e>"],
        "after": ["<C-d>"]
    },
    {
        "before": ["<C-y>"],
        "after": ["<C-u>"]
    }
]

With these settings, the behavior of Ctrl+E and Ctrl+Y is not exactly the same as in vim, but it's better than nothing; you get to scroll smoothly moving the cursor at the same time.

Of course, this solution assumes that you're not using Ctrl+D and Ctrl+U for scrolling (with the scrolling they provide by page).

claritician © 2022