Comparison of Vim and Emacs for a substitution operation using regular expressions
Table of Contents
This article is a summary of two previous posts that you can read at these pages:
- “Vim: Study on constructing Regular Expressions to delete or reduce blank lines with Global Command”
- “Emacs: Study on constructing Regular Expressions to delete or reduce blank lines”
The topic of “regular expressions” in Vim and Emacs is well suited for a functional comparison across the four different scenarios covered in the above articles to which I refer for a description of the syntax.
|Delete “pure” blank lines|
|Delete blank lines with whitespace|
|Reduce “pure” blank lines|
|Reduce blank lines with whitespace|
Emacs: what you type is not what you see
As explained in the article on Emacs, what you type is not what you see.
Below is a brief summary table for the operation of “reducing” blank lines, the third and fourth formulas in the above table, by distinguishing the keys pressed from the characters displayed.
The subject of regular expressions in Vim and Emacs shows several differences between the two editors.
I am unable to determine which implementation is the best one.
It is necessary, in any case, to consider that Emacs has a very good emulator of Vim, called Evil, that allows one to use the same regular expression language as the source editor.
Thank you for your attention.