Posts

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

Table Of Contents (TOC), from Org-Mode to Jekyll

Image
My Table of Contents What’s a Table Of Contents and why using it? Emacs Org-Mode and the autogenerated TOC Minimal-Mistakes over Jekyll provides an automatic TOC What’s a Table Of Contents and why using it? A Table Of Contents (“TOC”) is an index of a document’s content. In the world wide web environment it’s usually a list of chapter and sub-chapter headings in the online articles. Why using it? Obviously: the TOC can give you an overview of the documents’ structure, so you can quickly jump where you’re interested, without spending time reading the rest of the document. As a not-developer writer in GitHub of some posts, I’d like a simple and fast system to get the TOC of my articles. Emacs Org-Mode and the autogenerated TOC An excellent resource to generate a TOC is offered by Emacs with its extraordinary Org-Mode : if you write structure...

GNU/Linux multi-boot: from Grub to Burg and back to Grub2

Image
GNU/Linux multi-boot: From Grub to Burg and back to Grub2 Table of Contents 1. What's a Boot Loader in Linux? 2. From Grub to Burg 3. From Burg to Grub2: backgrounds and themes 4. Even easier: Grub Customizer 5. The easiest of all: Linux Manjaro Figure 1: GNU and Linux together 1 What's a Boot Loader in Linux? GNU/Linux, or simply Linux, can be installed in the same computer next to other operating systems. Linux users often install various distributions on different hard disk partitions to test their functionality and choose the best solution. The Boot Loader is a program that allows you to select the system to launch. Figure 2: A simple textual boot loader 2 From Grub to Burg One of the earliest boot loaders was LILO (LInux LOader). Throughout the 1990s it was used as the default boot loader for Linux distributions, then was gradually being abandoned for Grub . The first implementation of Grub was strictly tex...

Vim: Cut, Copy and Paste to and from the system clipboard

Image
Vim: Cut, Copy and Paste to and from the system clipboard Table of Contents 1. Cut, Copy and Paste using the computer keyboard 2. Vim and the clipboard 3. From Vim to the Clipboard 4. From the Clipboard to Vim 5. Some key shortcuts in gVim Figure 1: Vim 1 Cut, Copy and Paste using the computer keyboard Everybody knows how to use the keyboard combinations Ctrl-c , Ctrl-x , and Ctrl-v in Windows and Linux (or Cmd-c , Cmd-x and Cmd-v in macOS) to copy, cut and paste text across applications. Many think that those combinations are universal and work with any application. But Vim and gVim are different, they use another system to exchange information with the rest of the IT world. For example, in Vim under Linux, the key combination Ctrl-v corresponds to the visual block function and does not affect the pasting text. I wrote this article to remind me, as a non-programmer, the key combinations to be used in the Vim world to sha...