DEV Community

Discussion on: The Unix way... or why you actually want to use Vim

Collapse
 
temporal profile image
Jacek Złydach • Edited

Great article, showing an entire extra dimension for capabilities of a good editor.

RE the Emacs example, let me explain for posterity. This may look scary:

C-x h C-u M-| js2json

But it's actually built out of commands Emacs regulars would know well.

  • C-x h means "select all" (more accurately, the mark-whole-buffer command).
  • C-u is a "prefix argument", applying to the next command you issue; it's something used frequently.
  • M-| is shell-command-on-region; it'll take what you selected and pipe it into a shell command. Without a prefix argument, the output would end up in another Emacs buffer; with a prefix argument, it replaces the selection.

(And, of course, C-x is "control + x", M-| is "alt + |" in Emacs-speak.)

Cheers!