4 ms·
I've always disliked that Bram calls Vim a "modal" editor. All this means is your keyboard and mouse actions do different things based on what "mode" of the edi
by stevebmark 3y ago
I've always disliked that Bram calls Vim a "modal" editor. All this means is your keyboard and mouse actions do different things based on what "mode" of the editor you're in. All editors are "modal" editors. In VSCode for example, if you've focused the search box, pressing up loads the previous search, compared to if you've focused the code area, pressing up goes up a line.
Vim purports to be more efficient than other editors because it's a modal editor, but that's nonsense.
- schainks 3y agoNot all modal editors are created equal? Once fluent in vim, I could literally get more done in the same amount of time, but YMMV.
- colordrops 3y agoThat's not really the same thing though is it? Each of vim's modes are extremely complex with their own usage of the vim grammar. The "modal" behavior you describe is very simple.
- stevebmark 3y agoThey are the same thing of course, complexity is not relevant to the definition. The main difference is Vim's editing modes are imperative. You have to glue together small painful commands to do what you want. Modern editors are declarative - you say "I want to move this file" or "I want to rename this variable" or "I'll drag this split here" and they do the rest.
- minitech 3y ago> Modern editors are declarative - you say "I want to move this file" or "I want to rename this variable" or "I'll drag this split here" and they do the rest. Those are imperative actions rephrased to make an artificial distinction (and I rename variables in Vim with gR). How high-level the available actions are and being a modal or non-modal editor are orthogonal.
- beautron 3y ago> You have to glue together small painful commands to do what you want. Painful? Physically or mentally? Physically I find Vim to be pain-free. I've studied and I practice good typing form, which is important—I would look there before blaming any physical pain on Vim's commands. Mentally I find Vim's interface to be beautiful. Learning it gives your mind an amazingly coherent structure for thinking about the process of text editing.
- colordrops 3y agoIt wouldn't be disingenuous to call the F1 a race car just because a go-kart is also technically a race car. Vim is built around modal editing. It's entire workflow is built around it. Your argument is pedantic.
- broscillator 3y agoA GUI element is not a mode, categorically.
- nextlevelwizard 3y agoYou are confusing modes with different programs. In VSCode you have your editor program in the middle that does the editing things. Then when you invoke your search box it over takes the control away from your editor program and you are now in the search program which behaves however differently it behaves.
- thekiptxt 3y agoWhat makes you think that having the focus on the search box vs the code area in VSC constitutes a different mode in the same way as vim normal vs insert modes? You haven’t explained what you consider a mode to be. I think there is something very clearly different in vim, as first time users must have it explained to them that typing `j` when their cursor is at the start of the code area will do very different things depending on the mode they’re in. It’s a paradigm not present in editors like VSCode. This difference is usefully characterized as “modal”.
- teo_zero 3y agoSaying that VSCode is a modal editor because of the search dialog is like listing cars among USB peripherals because they have a USB port.
- eviks 3y agoThat's a bad example since search box is a different UI element Here modality mainly means "for the same element" (text area), and this is a very important and noticeable difference you can't eliminate with a search box
- wolverine876 3y agoUnlike the VSCode example, Vim's multiple modes utilize the exact same content and UI: With your cursor in the same place, and pressing the same keys on your keyboard, Vim's response will change based on whether you are in normal mode, insert mode, visual mode, or whatever mode. That's what they mean by modal. In insert mode, you have a ~104 keys that insert new text. In normal mode, the same ~104 keys execute editing functions. The magical efficiency is because of its modal nature: Without buying new hardware, by switching modes (at a keystroke) you have a magic input device that issues ~104 different editing commands each with one keystroke, and hundreds more with two-key combinations (shift+, ctrl+, etc.).
- beautron 3y agoModes are the core concept on which Vim's design is structured. They organize both the interface and the user's mental model of the text editing process. I did a quick case-insensitive search over Vim's help files, and they matched 'mode' 4470 times. The first thing you must learn (to use Vim) is that it is modal. And this detail really tends to stand out when first meeting Vim. I think "modal" is a nice word to concisely describe and differentiate Vim.
- Ferret7446 3y agoThere are 13875 matches for mode in the Emacs docs. Modes are even more foundational to Emacs than to Vim. A new user will encounter a dozen modes by simply starting to use Emacs for a few minutes. Every buffer has a major mode, and there can be many minor modes enabled per buffer or globally. The entire editor is built on a tree of modes, all inheriting from the aptly named Fundamental Mode. At a basic level, each mode affects what every key does. The idea of keys doing different things in different modes is not unique to Vim. Which just goes to show that Vim's definition of "modal" is somewhat contrived, as Vim's definition of "modal" applies to a very specific implementation of two to four modes (which coincidentally Emacs also offers multiple versions of, both natively and as third party packages to varying degrees of faithfulness).
- beautron 3y agoEmacs uses the word "mode" to mean something different than Vim does. An Emacs "mode" corresponds more closely to what Vim calls "plugins" (Emacs's "major modes" are like Vim's "filetype plugins", and Emac's "minor modes" are like Vim's other "plugins"). Vim's modes are more foundational in the sense that all Vim plugins are structured and organized in terms of the same set of modes. The core of Vim is the modes (insert, command, etc.), which are then customized. Emacs calls the customizations themselves "modes". I don't consider Vim's definition of "modal" contrived, and I don't consider Emacs to be "modal" in the same way (though you can of course customize it to be).
- beautron 3y ago> Vim purports to be more efficient than other editors because it's a modal editor, but that's nonsense. My understanding is that Vim purports to be efficient because it lets users make precise edits (large or small) with minimal input.
- bregma 3y agoThe VS Code behaviour you're describing is "focus contextual" rather than "modal". Modal behaviour means the behaviour can change modes within the exact same focal context.