Configure User Snippets in VSCode

Postgraduate in Communications Engineering with working experience in the Support Desk and self-study in software development.
Search for a command to run...

Postgraduate in Communications Engineering with working experience in the Support Desk and self-study in software development.
awk is a powerful programming language used for text processing and manipulation in Unix/Linux environments. It's particularly well-suited for tasks involving structured text files, especially when those files are data files or CSV files. It gets its...
The git log command is used to view the commit history of a Git repository. You can customize the output format to show specific details in a more readable or structured way. Below are some useful variations and formatting options for git log: To sh...

Overview This article will teach us how to: Install Ubuntu Server 24.04 on a laptop from scratch Install Ubuntu server by using Vagrant tool with ISO image Prerequisites: A laptop without any OS installed; A virtualization software Virtualbox t...

The /etc/passwd and /etc/shadow files are the backbone of Linux user management. Together, they store user account information and handle authentication securely. This article provides a hands-on guide to understanding these files, their structure, a...

In Linux, links are powerful tools that allow you to create references to files and directories. There are two main types of links: hard links and soft links (also known as symbolic links or symlinks). Understanding the differences between these two ...

A hostname is a human-friendly name given to a computer. It is a unique identifier that allows us to identify the machine in various network communications, making it easier to locate and manage devices. Type: hostname To see where it is stored, typ...

To work faster with VSCode, configure global snippets which will be available for all languages.
File -> Preferences -> Configure User Snippets -> New Global Snippets File -> FileNameYouChoose -> Enter
In the opened file, enter the following piece of code:
"Print to console": {
"scope": "javascript,typescript",
"prefix": "cl",
"body": ["console.log($1);"],
"description": "Log output to console"
},
"Arrow Function": {
"prefix": "arrf",
"body": ["const ${1:functionName} = ($2) => {", " $3", "}"],
"description": "Arrow Function"
}
When the snippets grow and it gets complicated to type out inside the body property, use the snippets-generator which will help you generate snippets based on your entered data and copy it to your snippets.code-snippets file on your VSCode.

Here, tabstops ($1, $2) make the editor cursor move inside a snippet and specify cursor locations. The number is the order in which tabstops will be visited.
Placeholders are tabstops with values, like ${1:functionName}. The placeholder text will be inserted and selected such that it can be easily changed.