Posts

Showing posts with the label Vim

Vim, Sublime Text, Visual Studio Code and the multiple cursors.

Image
ABSTRACT Article on comparative handling of multiple cursors in Sublime Text, Visual Studio Code and Vim. 1. Multiple cursors? Multi-cursors? What are we talking about? 2. Who "invented" multiple cursors? 3. Multiple cursors in Sublime Text 3 and 4. 4. Multiple cursors in Visual Studio Code. 5. Comparison of Sublime Text and Visual Studio Code. 6. Vim and the built-in multiple editing functions. 7. Effective multi cursors also on Vim. 1. Multiple cursors? Multi-cursors? What are we talking about? What are multiple cursors? An example is worth more than many words: imagine that you have a list consisting of a hundred lines and you have to insert a certain characters, for example a pair of asterisks, at the beginning and at the end of each term in the list. Try performing the operation manually a hundred times and then measuring the time spent! Now imagine, instead, entering those characters once for all the rows but using a hundred or so cursors si...

Vim and snippet lists for UltiSnips and other plugins.

Image
ABSTRACT Article about the different collections of snippets designed for different plugins of Vim and the possibility of converting from type of format to another. 1. Preamble 2. Steps for using snippets 3. Local custom snippets. 4. Honza : Why two different collections of snippets ? 5. Overview of both collections. 6. Is it possible to "mix" the snippets of the two collections? 1. Preamble In the article "Vim, UltiSnips and Honza vim-snippets: difference and management of the snippets and UltiSnips folders" I have already covered the topic of snippets and UltiSnips for Vim: This article is a refinement of the previous one, especially from the aspect of syntactic differences and the possibility of "mixing" together various code fragments from the collections of snippets . 2. Steps for using snippets For the introduction part about UltiSnips and Honza vim-snippets I refer to my previous article mentioned above. I briefly...

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 ...

Automatic generation of hyperlinks in LaTeX environment, using Vim's Regular Expressions, between PDF documents.

Image
Vim is an editor with endless capabilities. It can also generate hyperlinks in LaTeX language to other locally stored documents, thanks to its built-in Regular Expressions. For lawyers, this means linking a legal document with its related evidentiary materials. This is the analysis of the procedure. 1. Subject of this article. 2. Main document configuration. 3. RegEx formula for automatic link generation. 4. Explanation of the RegEx formula. 5. Management of "underline character". 6. Links within the text 6.1. "Indirect linkage" solution: 6.2. "Direct link" solution: 1. Subject of this article. Sometimes it is necessary to include in a main PDF document a list of documents to be retrieved with specific hyperlinks dedicated to each item in the list. For example: judicial acts with reference to related document productions. In this article I deal with the automatic generation of hyperlinks in LaTeX by Vim using...

From Text Objects in Vim to Text Blocks in Gutenberg for WordPress.

Image
1 Examples of “text objects” in Vim. 2 Examples of text blocks in Gutenberg. 3 Vim and Gutenberg together. 4 In conclusion. {{% toc %}} ## About Vim and Gutenberg . Vim is a command-line editor . Gutenberg for WordPress is a visual editor. Vim was created in 1987, as an evolution from the earlier Vi. Gutenberg has become the default editor for WordPress since version 5.0 of the CMS, released on November 27, 2018 . They are chronologically and structurally very distant writing tools. But despite the differences, there are also some similarities. Vim allows writing by treating text as an “object.” Gutenberg allows writing by treating text as a “block.” Vim’s “text objects” can be edited or moved “in bulk.” The same happens, of course, with Gutenberg’s “text blocks.” The principle of “block writing” has origins far back in time: Vim is the first example. Gutenberg the last. 1 Examples of “text objects” in Vim. Text objects ca...

Powerful OCR system under GNU/Linux for PDF documents managed from command line and with refinement by Vim.

Image
1 Introduction. 2 The installation of components. 3 OCR of PDF documents with “tesseract”: description of steps. 4 The single steps. 5 Everything in one command! 6 And now: Vim with RegEx. 7 In Conclusion. {{% toc %}} 1 Introduction. The idea came from reading this article about optical character recognition (OCR) in the GNU/Linux environment from images and PDF, managed from the command line. Obviously, PDF documents are those scanned from paper original, i.e., not obtained by direct saving of document in digital format. For the latter, no OCR is needed. The article is very well written and the end result is very good. I wondered if it would be possible to aggregate all the steps into a single text command. In this article I report my solution. Next, then, I added some con RegEx steps by Vim to reformat the raw result of optical recognition. Again, I tried to combine several separate formula...

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...

Vim and the Markdown preview

Image
1 Preamble 2 Previewing Vim in Markdown with the “Livedown” plugin 3 Previewing Vim in Markdown with the “Vim Markdown Preview” plugin 4 Simple solution without plugins 1 Preamble Vim is an excellent editor for Markdown, both for its own “native” features and for the possibility of adding specific functions via “plugins.” Previewing documents requires, unless you use the “manual” solution mentioned at the end of this article, using a dedicated “plugin.” Until a few years ago, my favorite was “ iamcco/markdown-preview.vim ” because it provided a true real-time live effect while typing text, even before periodic saving. Unfortunately, that project has been abandoned since February 2020. However, there are interesting alternative solutions that are the subject of these notes. The operating system predominantly used for this article is Arch Linux but there are indications for other GNU/Linux distributions as well. 2 Previewing...