Difference between revisions of "Design philosophies of Vim vs Emacs"

From Issawiki
Jump to: navigation, search
(Created page with " ==Modal vs chording== ==Session management: per project vs single instance== ==Multiple similar commands vs single repeated command== This one is a bit hard to explain, bu...")
 
Line 10: Line 10:
 
* Changing the screen view relative to cursor: Vim gives you zz to scroll so as to leave the cursor at the center of the screen, zt to scroll and put the cursor at the top, and zb to scroll and put the cursor at the bottom. Emacs just gives you a single command, Ctrl-l, which when repeatedly pressed, will cycle between all three views.
 
* Changing the screen view relative to cursor: Vim gives you zz to scroll so as to leave the cursor at the center of the screen, zt to scroll and put the cursor at the top, and zb to scroll and put the cursor at the bottom. Emacs just gives you a single command, Ctrl-l, which when repeatedly pressed, will cycle between all three views.
 
* Moving cursor to top, middle, bottom: Vim gives you H to move cursor to the top of the screen, M to move to middle, and L to move to bottom. Emacs just gives you Alt-r, which will cycle between the three configurations.
 
* Moving cursor to top, middle, bottom: Vim gives you H to move cursor to the top of the screen, M to move to middle, and L to move to bottom. Emacs just gives you Alt-r, which will cycle between the three configurations.
 +
* Folding: Vim gives you fine-grained commands like zo to open a fold, zc to close a fold, zR to globally reduce the fold level in the file, etc. Emacs as far as I know doesn't have folding by default, but certain major modes like org-mode and markdown-mode do have folding, and in these, you simply press TAB to cycle the different folding levels, or Shift-TAB to do the cycling globally across the entire file.
 +
* Vim gives you Y, D, C, to copy, delete, and change (respectively) until the end of the line. Emacs just gives you Ctrl-k, which it then expects you to creatively make use of (e.g. if you want to copy until the end of the line, you do Ctrl-k to delete until the end of the line, then Ctrl-/ to undo).
 +
* Vim has / to search forward, ? to search backward, then n or N to repeat that search in the same direction or opposite direction. Emacs just has Ctrl-s and Ctrl-r to do the search forward or backward. If you want to repeat the search, you just keep pressing Ctrl-s.

Revision as of 19:30, 27 November 2025

Modal vs chording

Session management: per project vs single instance

Multiple similar commands vs single repeated command

This one is a bit hard to explain, but there is a definite pattern where Vim prefers to give the user multiple similar commands, while Emacs prefers to give a single command that you can then repeat or use creatively. The best way to explain is to give a bunch of examples:

  • Changing the screen view relative to cursor: Vim gives you zz to scroll so as to leave the cursor at the center of the screen, zt to scroll and put the cursor at the top, and zb to scroll and put the cursor at the bottom. Emacs just gives you a single command, Ctrl-l, which when repeatedly pressed, will cycle between all three views.
  • Moving cursor to top, middle, bottom: Vim gives you H to move cursor to the top of the screen, M to move to middle, and L to move to bottom. Emacs just gives you Alt-r, which will cycle between the three configurations.
  • Folding: Vim gives you fine-grained commands like zo to open a fold, zc to close a fold, zR to globally reduce the fold level in the file, etc. Emacs as far as I know doesn't have folding by default, but certain major modes like org-mode and markdown-mode do have folding, and in these, you simply press TAB to cycle the different folding levels, or Shift-TAB to do the cycling globally across the entire file.
  • Vim gives you Y, D, C, to copy, delete, and change (respectively) until the end of the line. Emacs just gives you Ctrl-k, which it then expects you to creatively make use of (e.g. if you want to copy until the end of the line, you do Ctrl-k to delete until the end of the line, then Ctrl-/ to undo).
  • Vim has / to search forward, ? to search backward, then n or N to repeat that search in the same direction or opposite direction. Emacs just has Ctrl-s and Ctrl-r to do the search forward or backward. If you want to repeat the search, you just keep pressing Ctrl-s.