Chapter 3. Vim Editor

What Is Vim and How to Launch It?

What Is Vim and How to Launch It?
Tag:

Vim is an open-source Unix and Linux built-in text editor. It is also preinstalled in Mac OS. Vim is a contraction of Vi IMproved (Vi is an earlier version of a Unix text editor).

CUI-based text editor

Vim usually runs under the CUI (Character User Interface) environment. You can launch it from your command line. GUI-based text editors such as Visual Studio Code have been more popular recently; however, CUI-based text editors are still useful, especially when you manage a remote server. You can launch a text editor from your command line connected to the remote server. A GUI-based text editor can be used for a remote server; however, you need to do additional settings. To learn how to set up Visual Studio Code for SSH remote login, check Chapter 6 SSH Remote Login with Visual Studio Code .

Note: There is a GUI version of Vim called GVim, but a CUI-based Vim is more widely used.

Light and fast text editor

Vim is very lightweight software, which doesn't consume a lot of computer resources. As Vim is largely keyboard-operated, it requires some time to master; however, once you master all short-cut commands, your coding speed can be much faster.

How to launch Vim?

Type vim followed by a file path. If the file doesn't exist in the specified path, Vim creates a new file. If you edit a file named sample.txt under the current working directory, the command you can use is shown below.

Command Line - INPUT
vim sample.txt

IdeaNote: Practicing Vim on Mac OS and Windows OS

As Vim is preinstalled on Mac OS, you can practice using it by launching it from Terminal.

For Windows OS, you need to install it. You can download Vim from this site Downloading Vim .

Vim is an open-source Unix and Linux built-in text editor. It is also preinstalled in Mac OS. Vim is a contraction of Vi IMproved (Vi is an earlier version of a Unix text editor).

CUI-based text editor

Vim usually runs under the CUI (Character User Interface) environment. You can launch it from your command line. GUI-based text editors such as Visual Studio Code have been more popular recently; however, CUI-based text editors are still useful, especially when you manage a remote server. You can launch a text editor from your command line connected to the remote server. A GUI-based text editor can be used for a remote server; however, you need to do additional settings. To learn how to set up Visual Studio Code for SSH remote login, check Chapter 6 SSH Remote Login with Visual Studio Code .

Note: There is a GUI version of Vim called GVim, but a CUI-based Vim is more widely used.

Light and fast text editor

Vim is very lightweight software, which doesn't consume a lot of computer resources. As Vim is largely keyboard-operated, it requires some time to master; however, once you master all short-cut commands, your coding speed can be much faster.

How to launch Vim?

Type vim followed by a file path. If the file doesn't exist in the specified path, Vim creates a new file. If you edit a file named sample.txt under the current working directory, the command you can use is shown below.

Command Line - INPUT
vim sample.txt

IdeaNote: Practicing Vim on Mac OS and Windows OS

As Vim is preinstalled on Mac OS, you can practice using it by launching it from Terminal.

For Windows OS, you need to install it. You can download Vim from this site Downloading Vim .

Tag: