Install vim in AlmaLinux 9

In this article, we cover how to install vim editor in AlmaLinux 9. vim is a text editor, which is an improved version of vi editor. It is a free and open-source cross platform application. At the time of writing, v 9.0 is its latest stable release.

The packages for vim and its dependencies can be installed through BaseOS and AppStream repository. But, as of now v8.2.2637 is available through AlmaLinux repositories.

If you tried to edit a text file through vim and got the following error –

-bash: vim: command not found

That means vim isn’t installed in your machine. So, install the relevant packages and that is the sole reason for writing the article.

Note: Following operations require administrative rights. If you don’t have the rights, contact your System Administrator for assistance.

Install vim in AlmaLinux 9

As already covered, the vim and its related dependencies are part of BaseOS and AppStream repository. Therefore, all we have to do to install vim is –

# dnf install vim

For us it required 4 packages – vim-enhanced, gpm-libs, vim-common and vim-filesystem. It could be different for you.

If you are ok with the installation process, Press y.

Once the installation process is over, issue the following in terminal to launch vim –

vim

Use the following keyboard shortcut to quit –

:q

And, press Enter.

In conclusion, we have covered here how to install vim in AlmaLinux 9.

Additional Info –

For those who are new to vim, we cover here the basics of inserting text in the vim editor and saving it to a file.

To run vim editor –

vim

Press i, at the home screen to insert text. Notice, it shows — INSERT — at the bottom of editor.

Once you are done writing, press Esc key.

To save the file –> vim-test-file in the directory –> /dev/shm

:w /dev/shm/vim-test-file

And, press Enter.

If you wish to quit vim –

:q

Again, press Enter.

Alternately, we could have used the following key combination to save and quit the file at the same time

:wq  /dev/shm/vim-test-file

Similar Posts