How to Turn On Syntax Highlighting in Vim/Vi Editor
Table of Contents
Turn On Syntax Highlighting in Vim/Vi Editor
Vim is one of the popular text editors among the software developers & system administrators. The macOS as well as on different Linux Distros Vim comes preinstalled. We can edit code in Vim easily. But the syntax is not highlighted by default in Vim. In this tutorial, you are going to learn How to Turn On Syntax Highlighting in Vim/Vi Editor.
Turn On Syntax Highlighting in Vim
helloworld.c file by using the following command. (We have taken here
helloworld.c as a demo file you can open any program file.)
Esckey to come in normal mode if you are in any other mode.
The enter following command and hit
The output should be:
Turn On Syntax Highlighting in Vim Permanently
We can set syntax highlighting permanent by editing
~/.vimrc file. To do this run the following commands:
.vimrc file using the following command:
Now append the following text in the above-opened file and then save the file:
Here you have successfully enabled syntax highlighting permanently in Vim.
Turn Off Syntax Highlighting in Vim
You can turn off syntax highlighting by using the following command inside Vim:
In this tutorial, you have learned How to Turn On Syntax Highlighting in Vim/Vi Editor. If You have any queries regarding this please comment below.
How to Install Apache on Debian 10
How to Install XAMPP on CentOS 8
How to Install PostgreSQL on CentOS 7
How to Change Hostname on Debian 9
How to Install Laravel PHP Framework With Nginx on CentOS 7
How to Install IntelliJ IDEA IDE on Debian 9
How to Install Minecraft on Ubuntu 18.04
How to Disable SELinux on CentOS 7
How to Install DataGrip on Linux Mint 19
How to Install PyCharm on Manjaro 18
11 Wget Command Examples in Linux (Linux File Downloader)
How to Install Apache Tomcat 9 on Debian 10