0

As most people know, Vim descends from Vi which descends from Ex. Vim still has an Ex mode (Q if not using defaults.vim) that allows one to enter Ex commands repeatedly; use :visual to go back to the main Vim interface.

As far as I can tell, Neovim has replaced Q with a visual command for executing registers.

Is there anything that replaces this mode in Neovim?

2
  • The Ex mode is somehow hidden in Vim (default.vim remap Q to gq). I understand that you would like a more modern version of the Ex mode. It would be helpful to understand what you would like to achieve with the Ex mode or its modernized version. Could you elaborate on that? Commented May 27 at 15:22
  • I couldn't find a better "ex -> vi" reference because the "Interview with Bill Joy" (en.wikipedia.org/wiki/Vi_(text_editor)#cite_note-interview-3) appears to be unreachable for me at the moment.
    – D. Ben Knoble
    Commented May 27 at 18:04

2 Answers 2

3

First things first. There are two "Ex-modes" in Vim. One is for :h Q, and another one is for :h gQ. Let's explain the difference.

gQ is kind of Vim's extension. It works as if user types in the standard Command-line mode and keeps returning back to it (not to Normal mode as usual). So gQ internal implementation is really simple. It fully re-uses Vim's standard command-line editor. This mode still presents in both Vim and Neovim.

Q on the other hand is a POSIX thing. There's a whole piece of text in the POSIX docs to explain which keys must do what in the Q-mode. It is really "an emulation of Vi", "how it was done in the 70s by Bill Joy", etc. No fancy arrows, no mappings or abbreviations and such.

Therefore, to provide support for POSIX Q Vim had and still has a few hundred lines of code (mostly for "Ex-like line editing"). But Neovim never was a POSIX-compatible thing, so in Neovim Q was disabled long time ago (disabled completely, and not just by remapping keys that user can undo as in defaults.vim). But the actual code was still compiled. Until it was eventually deleted in 2021 (FYI, I submitted the patch).

0

The Ex-mode use case listed in the following answer have I believe lost traction over time.

The Ex-mode is even somehow hidden by default in Vim already (the default.vim remap Q to gq).

Neovim developers tends to reduce the backward compatibility for the sake of the maintainability of the software.

I believe very little effort has been spend in Neovim to modernize the Ex-mode.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.