Franco Pasut Web Site

  • it
  • About
  • Contact
  • Posts
  • Privacy

Posts

October 9, 2021

Vim: some modalities to open single or multiple documents

Synthesis table

Some Vim commands we’ll talk about:

I write To get
vim document_name To run Vim and open a document
gvim document_name To run Graphical Vim and open a document
vim file-1 file-2 file-n To run Vim and open multiple documents
vim -p file-1 file-2 file-n To run Vim and open multiple documents in tabs
vim -o file-1 file-2 file-n To run Vim and open multiple documents in separate windows with horizontal rows
vim -O file-1 file-2 file-n To run Vim and open multiple documents in separate windows with vertical rows
sp doc_name To split a new file while Vim is running
vs doc_name To vertical split a new file while Vim is running
tabe doc_name To open a new file in a dedicated tab while Vim is running

Vim offers a lot of options to open or create single or multiple files from the command line or while the application is running.

read more
October 1, 2021

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

read more
September 21, 2021

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

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?

read more
September 15, 2021

LaTeX: creating and using variables to save time and reduce typing errors

Variables and legal documents

My work consists of writing legal documents.

Legal documents are full of data and many of them have to be repeatedly inserted.

Think, for example, about the names of people or of places, dates of events, etc.

A method is needed to avoid manually repeating recurring data when writing documents, both to avoid wasting time and typing errors.

A good system is to use “variables”, i.e. placeholders that take on different values depending on the documents in which they are inserted.

read more
September 11, 2021

Emacs, Expand-region and LaTeX

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

read more
September 1, 2021

Vim: Cut, Copy and Paste to and from the System Clipboard

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 it’s not true.

Vim uses another system to exchange information with other applications.

For example, in Vim under GNU/Linux, the key combination Ctrl-v corresponds to the visual block function and does not affect the pasting text.

read more
  • ««
  • «
  • 9
  • 10
  • 11
  • 12
  • 13
  • »
  • »»
© Franco Pasut Web Site 2026