Contact Us

Vim: Increment and decrement numbers

In Normal mode, Ctrl+A increments a number by one, and Ctrl+X decrements a number by one. This will work on numbers at or after the cursor. So the cursor does not need to be on the number. But the “after the cursor” thing works only if the cursor is on the same line as the number. Like most Normal mode commands, increment and decrement support numeric prefixes. For example, pressing 5Ctrl+A will increment the number by 5.

Read More ...

Convert images to 1-bit color using Faststone Image Viewer

Faststone image viewer can be used to create images that use only one bit per pixel. That is, the image will contain only pure white and pure black. Unlike grayscale images, a 1-bit image will not have any shades of gray. This can be useful if you want to scan and print old documents. Even if you use the black and white option in your scanner software, with old documents, you will most likely end up with a gray background.

Read More ...

Learning Vim script: How to execute scripts

A Vim script file consists of a series of colon commands, also known as Ex commands or command-line commands. Even language constructs like loops, functions, etc are also colon commands; more on that later. Use the source command to execute a script file. :source script.vim It is not compulsory to use .vim as the extension for Vim script files, but it is the custom and is recommended. The source command executes each statement in the script.

Read More ...

Solution for Windows Terminal not starting

Since the new Windows Terminal is still in active development, it often tends to develop starting troubles, especially after Windows updates. Here are three possible solutions. Make a backup of the settings.json (formerly profiles.json) file before attempting these solutions. The first solution does not require a backup but it is better to make one anyway. Settings.json can be found in %LocalAppData%\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState Solution 1: Repair Search for Windows Terminal in the Start Menu.

Read More ...

Vim script: Functions

Functions in Vim script starts with the function keyword and ends with the endfunction keyword. 1:function PrintMessage() 2 :echo "Hello World" 3:endfunction To run this function use the call command: 1:call PrintMessage() Function names User-defined functions in Vim script must start with a capital letter unless they are explicitly scoped. This is to prevent name conflicts with Vim’s internal functions. Functions without an explicit scope like the one in the previous example, have global scope.

Read More ...

How to change language of Google account using Google website

Steps Go to https://myaccount.google.com/ From the side panel click Data & Personalization Scroll down to General preferences for the web or type Ctrl+F and search for language Click Language Click on the Edit icon Search for your language and click on it to select it. Click the Select button. For some languages, you may have to choose a region. Fix for language change not working Sometimes even after changing the language, the old language might persist in the UI.

Read More ...

Vim script : How to use an expression in a Vim command

Many Vim commands do not support variables or expressions. cd ProjectRootGet() A command like the above one will not work in Vim, you have to supply literal values as parameters. But Vim provides ways of working around this limitation. Backtick Equals If the Vim command expects a filename or directory as a parameter, as in the above example, you can use the backtick equals option to supply an expression as parameter.

Read More ...

Bash: Using or setting a default value for null or unset variables

If a variable is not set or if its value is null, the default behavior of Bash is to expand it to a null string. Bash provides three alternatives to this default behavior. Use a default value instead of the null string. Set a default value for the variable and use that value. Display an error message and exit the script with an exit code of 1. To make use of these features you need to use the full syntax for accessing variables: ${variable_name}.

Read More ...

Vim Abbreviations

Vim abbreviations can be used to automatically expand words or phrases which you commonly use. It can also be used to correct common spelling mistakes. Use the abbreviate command to define abbreviations, the command can be shortened as ab. Abbreviations work in the insert and command-line modes. Define the following abbreviations. 1:ab teh the 2:ab jdm [email protected] Now type “teh” followed by a space, it will autocorrect to “the”. Similarly, “jdm” will expand to “john_doe@gmail.

Read More ...

How to record your screen using VLC

VLC, the popular media player, has a lot of features in addition to simple media playback. One of those features is the ability to record your screen. VLC vs OBS Screen recording in VLC is very easy. It has the added advantage that you probably already have VLC installed on your computer. But simplicity also means fewer features. If you want more features and are willing to live with the extra complexity, OBS should be your choice.

Read More ...