Franco Pasut Web Site

  • it
  • About
  • Contact
  • Posts
  • Privacy

Posts

September 12, 2022

Comparison of Vim and Emacs for a substitution operation using regular expressions

Preface

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.

read more
September 5, 2022

Emacs: Study on constructing Regular Expressions to delete or reduce blank lines

After writing an article focusing on “Vim: Study on constructing Regular Expressions to delete or reduce blank lines with Global Command” I tried to match with a similar operation with Emacs.

The goal is to study the differences in syntax related to “regular expressions” between two writing systems.

The following is the result of my attempts after various searches on the net.

Removing blank lines in Emacs using RegExp

First of all, it may be useful to display the blank lines in the document.

read more
August 15, 2022

Vim: Study on constructing Regular Expressions to delete or reduce blank lines with Global Command

Preface

On the topic of this article you may find interesting the following one: “Vim and Regular Expressions for removing redundant whitespace”.

Unlike the previous article, here the presence of whitespace causes different solutions than blank lines regardless of the number of their occurrences.

The study in this article is focused on both the analysis of “regular expressions” and Vim’s global command.

Vim and the Global Command

The Global Command in Vim is the g key.

read more
August 5, 2022

What is intended by "line" in Vim? How to configure a dual alternate mode of movement between lines?

Why is the Vim line definition “special”?

In Vim a “line” is a set of characters that ends with a return line.

Is that all?

It seems obvious, but how does it differ from the definition of “line” in other writing systems?

Simple: in other environments usually “lines” break at the right margin of the monitor. In Vim they don’t.

Nothing changes for short lines, that is, lines that do not exceed the margin right margin.

read more
July 19, 2022

Vim and Regular Expressions for removing redundant whitespace

Introduction and structure of the article

I wrote this article to practice “in situ” formula construction of Regular Expressions also called RegEx in Vim.

In particular, the goal is to “clean up” documents with excess whitespace at both the beginning and end of each line.

A basic knowledge of Vim and the Regular Expressions built into the editor is sufficient for understanding the article.

The various formulas are applied to whole documents but, since they are very normal search commands in Vim, they can be applied to individual rows or to specific ranges of rows in the context of the document.

read more
July 11, 2022

Jumping between matching pairs of characters and tags in Vim and Emacs

It is very useful to jump through corresponding pairs of characters, such as parentheses or tags, when coding or writing in a markup language such as HTML, Markdown or LaTeX.

Both Vim and Emacs have dedicated commands for this purpose.

To jump between matching pairs using Vim

Vim uses a “single character” command to jump to the nearest pairs of corresponding characters and to place the cursor into the closing one: %.

read more
  • ««
  • «
  • 6
  • 7
  • 8
  • 9
  • 10
  • »
  • »»
© Franco Pasut Web Site 2026