For my daily system administration job I have to login to many SuSE Linux servers and do various configugration edits.
The systems are configured in different ways and the only text editors available across all servers I can use are VI and VIM (VI Improved).
As I usually had to edit configuration files and scripts and I'm on SSH color terminal its rather annoying that on some of the servers opening a file with VIM is not displayed with SYNTAX HIGHLIGHTING. Not having syntax highlighting is ugly and makes editting ugly and unreadable.
Thus it is useful to enable VI syntax highlighting straight into the file being editted. I suspect many novice sysadmins might not know how to turn syntax highlighting in vi so here is how.
Turn Syntax Highlighting in VIM
1. Open file with vim lets say Apache configuration
# vim /etc/apache2/apache2.conf
2. Press (Esc) Escape and ":" from kbd and then type in syntax on
To Turn On / Off VI Syntax Highlighting permanent add ":syntax on"
~/.vimrc file is red automatically on VIM start, so right after :syntax on is appended in it on relaunch vim will start showing colorfully.
Enjoy ! 🙂
More helpful Articles
Tags: code, conf, configuration files, configured, editor, editting, file, howto, indent, Press Esc Escape, servers, syntax, sysadmins, system administration, text editors, turn, Turn Syntax Highlighting, vim, www