Posts

Showing posts with the label Emacs

Vim... beyond Vim

Image
Table of Contents 1. Vim in five minutes 2. Not a tutorial about Vim 3. Vim in Emacs: Evil Mode, the emulator par excellence 4. Vim in Sublime Text 5. Vim in Visual Studio Code 6. Vim in Zed: the youngest 1. Vim in five minutes Vim is not just a text editor, it is an editing language that allows you to interact with text through logical key combinations. The basis of Vim's "language" is the "modal" system. The main modes are as follows: Normal Mode : The "command center." Each key is a movement or modification command. Insert Mode : Where you actually write the text. Visual Mode : For selecting blocks of text. This separation eliminates the need to use the Ctrl key or mouse for every operation, reducing hand fatigue. In Vim, your hands never leave the center position of the keyboard. Basic movements are performed with h, j, k, and l, but the real power lies in semantic jumps: Words : w (jump to the beginnin...

Markdown with Vim, Emacs, Sublime Text 4 and Visual Studio Code

Image
Abstract: 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. 2.1. Vim without plugins . 2.2. Vim with the plugin vim-markdown. 2.3. Vim with the plugin UltiSnips. 2.4. Vim and Markdown preview. 3. Emacs and Markdown. 3.1. Emacs without plugins . 3.2. Emacs with markdown-mode . 3.3. Emacs and preview in Markdown. 4. Sublime Text 4 and Markdown. 4.1. Sublime Text 4 without plugins . 4.2. Sublime Text 4 with the plugin "MarkdownEditing". 4.3. Sublime Text 4 and preview in Markdown. 5. Visual Studio Code and Markdown. 5.1. VSCode without plugins 5.2. VSCode with ...

Notes on resolving differences between two documents with the built-in resources of Vim and Emacs

Image
1 What are we talking about? 2 The test documents. 3 Vim and the vimdiff function. 4 The “vimdiff” interface. 5 Emacs and the “ediff” function. 6 How do you use ediff ? 7 The “ediff” Interface. 8 Summary table. 1 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. All operations were performed in a GNU/Linux environment, specifically Ubuntu and Arch. I do not mention any additional plugins in the article, although they exist, and I do not address the issue of version control with git . There is no “merit opinion” on the two writing systems, just a concise exposition of t...

Emacs, portable self-installing configuration with “use-package” and “straight”

Image
1 Emacs, use-package and straight in short. 2 What is configuration exportability? 3 Beyond exportability: “straight”. 4 Configuring “straight”. 5 Configuration of “use-package”. 6 Little example with little analysis. 7 List of applications in my configuration file. 8 And now? 1 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 by i on the desired packages and x for the actual installation of the selected packages. To update packages you open the package-list above...

Converting from Org Mode to Markdown GFM

Image
Converting from Org Mode to Markdown GFM Table of Contents 1. Does it make sense to talk about Org Mode instead of Markdown? 2. The export problems 3. Some examples to make it clearer 4. The solution: export from Org-Mode to Markdown via Pandoc with GFM option. 5. The special case of exporting code blocks. 1. 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. So: to write in Org-Mode, it's best to must use GNU/Emacs. Org-Mode is a complete and extremely powerful structured writing system, alth...

Vim - VimTex, Emacs - AucTeX: create environments in empty fields

Image
Table of Contents 1. Subject of this post 2. Add environment tags in LaTeX to empty objects using Vim 3. Add environment tags in LaTeX to empty text using Emacs and AucTeX 4. Vim vs Emacs, or VimTeX vs AucTeX 1. 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? " Here I will add some considerations about tags for environments in LaTeX by using Vim, but now in empty objects , that is, ...

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

Image
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. Comparation Table Target Vim Emacs Delete “pure” blank lines :g/^$/d M-x flush-lines <RET> ^$ <RET> Delete blank lines with whitespace :g/^\s*$/d M-x flush-lines <RET> ^\s-*$ <RET> Reduce “pure” blank lines :g/^$\n^$/d M-x query-replace-regexp <RET> ^C-qC-j\{2,\} <RET> C-qC-j <RET> Reduce blank lines with whitespace g/^\s*$\n^\s*$/d ^\(^C-q<SPC>*C-qC-j\)\{2,\} <RET> C-qC-j <RET> Emacs: what you type is n...

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

Image
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. To preview blank lines, you can use the whitespace-mode function ( M-x whitespace-mode <RET> ): blank lines will be marked with dollar signs, i.e., lines in which there is no character, not even white space. At this point you can select a region or operate on the entire document from the cursor point with the flush-lines function, or the alias delete-matching-lines , to remove lines that match a search command: M-x flush-lines <RET> ^$ <RET> The formula’s meaning is a...