Posts

Vim, Markdown, Snippets, UltiSnips: how to get a well-formatted link with a single command

Image
Vim, Markdown, Snippets, UltiSnips: how to get a well-formatted link with a single command Table of Contents 1. Objective of this post 2. An interesting solution found on the net 3. My solution 4. A simple animation 1 Objective of this post The objective of this post is to get a correctly formatted link in Markdown by merging in a single command a fragment of text and an Internet address previously saved in the Vim clipboard. Of course I assume that everybody that's reading this post knows how to create a well formatted link in Markdown, i.e. text in square brackets and URL in round brackets. Why did I ask myself this question? Very simple: I noticed that in "the-other-side-of-the-moon-called-Emacs" the link construction from a region (i. e. a selected text) is immediately available (markdown-mode, C-c C-l ) whereas in the honza list, which is used by Vim UltiSnips plugin, the same function is not among the presets. ...

Emacs, Expand-region and LaTeX

Image
Emacs, Expand-region and LaTeX Table of Contents 1. Emacs and text objects 2. Expand-region and LaTeX 3. Video clips about LaTeX and expand-region 4. Evil: i.e. Vim within Emacs 1 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 ". To install the package, please read the programmer's instructions . Although the package also works in generic text documents, it must be used, for optimal performance, inside one of the language modes listed in the...

LaTeX, LilyPond and lyluatex package: state-of-the-art text and music typesetting

Image
LaTeX, LilyPond and lyluatex package: state-of-the-art text and music typesetting Table of Contents 1. LaTeX and LilyPond 2. Prerequisites for understanding this article 3. The LilyPond official solution 4. The single command solution: lyluatex package 5. INLINE EXAMPLE: 6. BLOCK CODE EXAMPLE: 1 LaTeX and Lilypond LaTeX is a " state-of-the art" pagination system for text, maths and more. LilyPond is the same for musical scores. LaTeX and LilyPond together are a true excellence to mix music notation and text within same documents. But it is not so easy to generate documents by using that combination of markup languages. This post is intended as a simple introduction to start using LaTeX and LilyPond in documents containing text and music notation. 2 Prerequisites for understanding this article In order to understand the content of this article, it is of course necessary to know the markup languages it deals with: ...

Vim: searching for text containing a slash or a question mark

Vim: searching for text containing a slash or a question mark Vim: the search command To activate a text search in Vim, press one of the following trigger keys in your keyboard: the slash "/" key (do not confuse with the back-slash "\" key) the question mark key. By pressing the slash "/" key will activate a forward search. By pressing the question mark "/" key will activate a backward search. To move the cursor to the results in your document, press the "n" key (mnemonic for “ next ”). To invert the direction of the cursor, press the "N" key, (“upper n”) . What about if you need to search for a slash or a question mark , i.e. the same trigger characters , in your document? You can prepend the Escape character to the trigger key. The Escape character The Escape character is the back-slash key: "\" . Just an example: if you need to forward search (then with / trigger k...

Vim: vertical motions through full or wrapped lines

In Vim a line is a set of characters ending with a Carriage Return. What’s so special about that definition? Think about wrapped lines that exceed the right edge: Vim handles each wrapped line as belonging to one line only. Standard vertical motions in Vim using j e k keys or the arrow keys occur within full lines. You can jump through wrapped lines by adding the g key to j e k . But, did you know that you can have both movements available without adding any keys? You can remap arrow keys by insering the following code in the .vimrc configuration file: nnoremap <Down> gj nnoremap <Up> gk vnoremap <Down> gj vnoremap <Up> gk inoremap <Down> <C-o>gj inoremap <Up> <C-o>gk From now you will be able to use the arrow keys for the motions through wrapped lines and the jk keys for the default Vim motions.

Vim: two methods to append blank lines under multiple text lines

My Table of Contents What are we talking about? The Regular Expression solution The Global Command solution

GoHugo: time to move on to modules

My Table of Contents Hugo Academic: from Theme to Modules Prerequisite: Go installation The outline: from Academic to Wowchemy Simple scheme to switch to modules in a Hugo Academic based site under Linux Mint

Emacs, Markdown-mode, insert spaces in text links created by the C-c C-l command - My Notebook Home

Image
  How to insert text links in Emacs Markdown-mode ( C-c C-l ) with spaces inside them The reference environment: Emacs, Markdown-mode, insert a link The official assistance service solution 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. The following are the steps: Activate the command C-c C-l Insert the URL of a link and press Return Insert text link with some spaces inside it … STOP! You could notice that the minibuffer does not accept the spaces! You also...

Join lines in Emacs using US International Dead Keys layout

Image
Join-lines: Vim vs Emacs Caret or Circumflex The original keys binding An alternative binding 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. What follows is my solution but, of course, everyone can find another one. Caret or Circumflex First of all we need to take a look at the US International Dead Keys keyboard layout for the key corresponding to the number 6 and, in specific to the two similar characters indicated on the top of the key. You can see that on the number 6 button ...

Vim, flash movements between windows with EasyMotion

Image
Vim, flash movements between windows with EasyMotion Table of Contents 1. Quick introduction 2. Installation and configuration of EasyMotion 3. Use of EasyMotion in Vim 4. Examples with images 5. In brief Figure 1: Vim like a lightning bolt 1 Quick introduction Vim can quickly jump through different documents at a lightning speed. Do you remember when you had to move the cursor using the arrow keys and pressing them continuosly until the final point? If you use Vim, the above actions will be only bad memories. You only have to install the /EasyMotion / plugin and make a miniml configuration. 2 Installation and configuration of EasyMotion The EasyMotion plugin installation is really a kid's joke. If you use Vim Plug as your plugin manager , actually it's my favourite one, you only have to insert in your .vimrc the following text strings: Plug 'easymotion/vim-easymotion' Plug 'haya14busa/incse...

How to install what you need to run the command bundle exec jekyll serve in Linux Mint

If you have to run the command “bundle exec jekyll serve” in Linux Mint Install Ruby Install the GNU Compiler Collection Nokogiri needs zlib Summary table That’s all, I hope If you have to run the command “bundle exec jekyll serve” in Linux Mint I’ve repeatedly had to run a series of installations in Linux Mint to make the bundle exec jekyll serve command working. The possibility to test your Jekyll static sites locally before pushing them on GitHub is really useful. But the basic Linux Mint installation lacks some important pieces of code. So not only do you have to install the Ruby language but also some other piece of code needed for the system to work. After browsing the web several times to collect the instructions I decided to consolidate them into a single post. Now I am on Mint 19.3 Cinnamon edition. Install Ruby The first step is to install Ruby . The easie...