Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

What's a "modal editor"? I don't really understand what's so unique about this.


Modal editing is an older concept, where by-default you can't hop in and start typing like normal. Most modal editors (including Helix) start you in a Normal mode, which is mostly used for reading and searching documents. Then you press a button (usually i or a) and get put into an Insert mode, where you can edit the text and type to your heart's content. Pressing escape will drop you back into Normal mode when you're done, where you can save the document and exit the editor.

It's a different workflow, but kinda nice when you want that IDE-style experience in a simpler interface like a TUI.


When you're not in insert mode, you have the whole alphabet of keyboard keys to act on the text without Ctrl/Alt/Shift/whatever combinations. So you can get a lot done with very few key presses, using shortcuts that make sense (e.g. "t." to select all text "to the next dot", and all that without straining your hands as you'd do when you use Ctrl/Alt/Shift modifiers. That last point is how I got into modal editors: Emacs keybindings were aggravating my RSI symptoms. It went away when I started using vim (and now helix).


Modal editors like vim and helix have modes[0] that allow for different operations.

Vim has

- normal mode which allows you to enter commands to manipulate text rather than just type characters in the file

- insert mode which allows you to enter text into a file

- replace mode which allows you to replace text

and a few others.

Most editors like vscode, sublime etc only have a single mode that they are always in IE insert mode. Modal editors have additional modes that allow for additional capabilities.

[0]https://www.freecodecamp.org/news/vim-editor-modes-explained...


Just an editor with modes. Ie in vim you have have the default normal mode (move with hjkl) to move around the code without having to move your hands over to the arrows, insert mode to enter text, visual mode to select text, etc.


It typically means "something like vi", where there are "modes" like insert, normal, command, replace, visual, etc. that completely change the keybindings and are switched between by pressing certain keys in certain modes.


a modal editor is an editor with different editing modes, like Vim or Helix. Notepad for example is not a modal editor, and neither is VSCode by default.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: