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 PhpStorm on Linux Mint 19
How to Install Microsoft PowerShell 6.2.0 on Ubuntu 18.04
How to Add Swap Space on CentOS 7
How to Add Swap Space on CentOS 8
How to Install PostgreSQL on CentOS 7
How to Install FFmpeg on Debian 9
How to Install Node.js with npm on Debian 10
How to Install CMake on Linux Mint 19
How to Install Atom Editor on Ubuntu
How to Install Node.js with npm on Linux Mint 19
How to Install PostgreSQL on Ubuntu 18.04
How to install Android Studio on Ubuntu 18.04