Below you will find pages that utilize the taxonomy term “Emacs”
Markdown with Vim, Emacs, Sublime Text 4 and Visual Studio Code
How are four generalist editors, i.e., designed to be used with a wide range of programming languages and text files, performing when writing documents in Markdown language? This is the subject of this article based on my personal experiences in using Vim, Emacs, Sublime Text 4 and Visual Studio Code both directly and with extensions dedicated to the above mentioned markup language.
- 1. Introduction.
- 2. Vim and Markdown.
- 3. Emacs and Markdown.
- 4. Sublime Text 4 and Markdown.
- 5. Visual Studio Code and Markdown.
- 6. In summary.
1. Introduction.
Markdown is a simple markup language that is within anyone’s reach, compatible with HTML, and allows very elegant, well-formatted text to be written for both web and print publication.
Notes on resolving differences between two documents with the built-in resources of Vim and Emacs
What are we talking about?
In this article, I report my practical experience on how to use the built-in resources of Vim and Emacs to resolve and undo differences between two documents.
In fact, I’ve occasionally updated two documents in such a “messy” way that I could no longer remember which updates to keep on one and the other.
Both Vim and Emacs offer very simple and effective built-in tools for checking and resolving such differences.
Emacs, portable self-installing configuration with "use-package" and "straight"
Emacs, use-package and straight in short.
Emacs uses the GNU ELPA (Emacs Lisp Package Archive) for updating installed packages.
MELPA (Milkypostman’s Emacs Lisp Package Archive) is, on the other hand, an unofficial manager with numerous other packages and must be installed by following the directions on this page.
The original methods for installing packages are as follows:
M-x package-install <RET> package-name <RET>
M-x package-list-packages <RET>
followed byi
on the desired packages andx
for the actual installation of the selected packages.
To update packages you open the package-list above and press U
followed by x
.
Converting from Org Mode to Markdown GFM
Does it make sense to talk about Org Mode instead of Markdown?
Why should I use Org-Mode to write articles to be published network in Markdown format?
Wouldn’t it be more convenient to write the articles directly in Markdown?
The question is more than justified and the answer is not obvious.
First, let me remind you that Org-Mode is a mode of GNU/Emacs. While there are various plugins for other editors, including Vim, none of them can match the outstanding efficiency of the original system.
Vim - VimTex, Emacs - AucTeX: create environments in empty fields
Subject of this post
This post is a follow-up to my previous one named “Vim, VimTex: environments and commands in LaTeX” in which I described the creation of environment tags in the LaTeX language through Vim’s “surround.vim” plugin.
Specifically, I described how to add environment tags to words and lines objects non-empty, that is, starting from already existing text.
If you need a reminder about the concept of “line” in Vim, you can refer to this article of mine: “What is intended by “line” in Vim? How to configure a dual alternate mode of movement between lines?”
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.
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.
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: %
.
Using Emacs to write scores in LilyPond
About LilyPond
LilyPond is a language for producing elegant musical scores, structurally similar to LaTeX with which it can integrate to generate documents containing text and music (for the integration between LilyPond and LaTeX you can read to this article of mine.)
Also in LilyPond, as in LaTeX, you can write the content with various editors.
Very useful, especially to learn the syntax, is the editor called Frescobaldi.
For those who have already learned the syntax, it may be useful, instead, to use the endless potential of Emacs and Vim,
Variables in LaTeX documents exported from Emacs Org Mode
The usual introduction to Emacs, Org Mode and LaTeX
This is the usual introduction to Emacs, Org Mode and LaTeX: if you already know everything you can skip it.
Org Mode under GNU Emacs is a very powerful tool for organizing ideas.
An excellent features of this tool is its ability to directly export documents from Org Mode to LaTeX, the absolute excellence for pagination, as well as to other languages such as Markdown and HTML.
Emacs, Expand-region and LaTeX
Emacs and text objects
In composite documents there are often text fragments within well-defined semantic elements: parentheses of various kinds, single or double inverted commas, trailing commas, etc.
In some text editors (Vim, in particular) they’re called “text objects”.
Emacs can handle these text blocks with a package called Expand-region that “increases the selected region by semantic units (original definition from the programmer’s GitHub page): parenthesis, brackets, quotes, sentences and other objects”.
Animated GIFs about basic RegEx in Vim and Emacs
A non-preface about RegEx
In my little experience as a LaTeX writer using Vim and Emacs, I sometimes use the extraordinary efficiency of RegEx, also known as RegExp or “Regular Expressions”.
Vim and Emacs, provide built-in support for RegEx.
I’ll show you in the following clips some elementary uses of regex in both editors.
The software developer community will smile, but the following animated GIFs are intended for writers, not computer programmers.
Join lines in Emacs using US International Dead Keys layout
Join-lines: Vim vs Emacs
Vim has a very simple system to join two lines. All you have to do is press the J
(uppercase) key inside the line above.
In Emacs, instead, you must use the C-^
binding in the lower line.
But the Emacs solution may seem a bit more laborious if you use a keyboard with US International Dead Keys layout in MS Windows or GNU/Linux.
However, with a few small adjustments, it can become super-efficient.
Emacs, Markdown-mode, insert spaces in text links created by the "C-c C-l" command
The reference environment: Emacs, Markdown-mode, insert a link
This article applies to the following environment:
- Emacs: GNU Emacs 26.3 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.30) of 2019-12-03
- Markdown Mode: markdown-mode-20200622.20
- OS: Linux Ubuntu 20.4 LTS, Linux Fedora 32
The problem in a few words: You need to insert a link in a document written using Markdown-mode for Emacs and in the Link text you need to insert one or more spaces.