Skip to content

[Bug] Vim Motions in Visual Mode #825

Closed

Description

@vinivinoo

While in Visual Mode, you can't use the Vim Motions CTRL+D and CTRL+U

Activity

  1. adibhanna commented on Sep 21, 2026

    @adibhanna
    Contributor

    Thanks for the report, @vinivinoo. Reproduced in the built app and fixed in 450df3e on the v2.54.0 branch, so it ships with 2.54.0.

    Cause. Ctrl+D and Ctrl+U were wired as normal-mode-only Vim actions, and an action cannot extend a visual selection at all (it moves the editor's cursor but not Vim's own selection). With visual mode unmapped, the key never reached Vim there and fell to the editor's built-in shortcuts instead. On Linux and Windows those are "select next occurrence" for Ctrl+D and "undo selection" for Ctrl+U, which is why v then Ctrl+D stacked a new cursor on every press and Ctrl+U undid the selection, with no scrolling either way. On macOS the keys fell to the Vim plugin's stock motion, which happens to move on a plain note but is the one ZenNotes had replaced in normal mode because it can snap the cursor back to line 1 with Live Preview on.

    Fix. The half-page move is now a real Vim motion, mapped in normal and visual mode. v (or V) then Ctrl+D grows the selection by exactly the distance Ctrl+D moves the cursor in normal mode, and the view scrolls along; Ctrl+U shrinks it back; Escape leaves the cursor where the selection ended. A count works the Vim way (5 Ctrl+D moves five lines). It never wraps at the top or bottom of a note. The same fix reaches floating note windows, the Quick Note window and files opened from outside the vault, which had their own editor and never had the keys mapped. Your configured half-page bindings (Settings → Keymap → Half-page down / Half-page up) apply in both modes in the main editor.

    How to test once 2.54.0 is out. Vim mode on, open a note longer than the window, gg, then v and press Ctrl+D twice, then Ctrl+U.

    Before: on Linux and Windows, each Ctrl+D adds another cursor at the start of the next line and nothing scrolls; Ctrl+U undoes the selection. After: the selection grows from line 1 down half a page, then a full page, with the view scrolling to follow, and Ctrl+U shrinks it back by half a page. The same in a floating note window (right-click a note or its tab, Open in Floating Window) and in the Quick Note window.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions