Posts

Showing posts from November, 2022

Vim, VimTex: environments and commands in LaTeX

Image
Vim, LaTeX and VimTex: surround commands Table of Contents 1. A smart system for writing 2. VimTex Built-in functions for environments and commands 3. Create a surround function in VimTex based upon surround.vim plugin 1. A smart system for writing Vim is a great editing tool. LaTeX is a "State of the Art" typesetting system. Vim and LaTeX together make a powerful writing system, but an add-on is needed to relate them. VimTex provides exactly that target by relating Vim to LaTeX, and it does its job very well. So Vim and VimTex is a smart system for every kind of writer in LaTeX. The topic is vast and certainly cannot be contained in a short post like this one. In this article, I simply cover functions for managing environments and commands. 2. VimTex Built-in functions for environments and commands I assume that those who use LaTeX already know the difference between commands and environments. VimTeX ha

Vim Is Magic or Nomagic?

Image
What’s this joke? The title is a joke with the name of “ V.I.M. ” but, at the same time, it’s a real mode of Vim itself: the Magic Mode . To understand what Magic Mode is, the primary source is the item :help magic in Vim. In a few words: - The Magic Mode refers to the regular expressions - The Magic Mode is enabled by default in Vim. - You can explicitly invoke the Magic Mode with the \m command in the RegEx search area. - To deactivate it you must set \M (capitalized m ) in the RegEx search area. - When you use the \M command you invoke the Nomagic Mode . - Nomagic Mode turns “ almost all special regex symbols into ordinary ones unless they start with a backslash ”. - There is also a Very Nomagic Mode that extends the effect to other characters, not relevant to this article. When is magic mode (default) better than nomagic? To analyze the difference between magic and nomagic mode, I resume a formula from a previous article of mine . It’s the Vim RegEx formula for