Pages

Friday, June 23, 2017

VI Editor Syntax Highlighting with VIM on RHEL / CentOS / Fedora

This how-to guide covers how to install and enable Syntax Highlighting in VI using VIM (enhanced) text editor on RHEL 6.3/6.2/6.1/6/5.8/5.6CentOS 6.3/6.2/6.1/6/5.8/5.6 and Fedora 17,16,15,14,13,12. By default on all Linux systems only have minimal version of VI with plain text editor and that works perfectly for normal users, but for programmers and developers it becomes very difficult to identify the code parameters. To enable Syntax Highlighting in VI, we required enhanced version of VI editor called Vim (Vi IMproved).

Syntax-Highlighting in VI Editor
Syntax Highlighting in VI Editor on Linux
VIM is an alternative and advanced version of VI editor that enables Syntax highlighting feature in VI. Syntax highlighting means it can show some parts of text in another fonts and colorsVIM doesn’t show whole file but have some limitations in highlighting particular keywords or text matching a pattern in a file. By default VIM works on all Linux terminals, but some terminals have minimal highlighting capabilities to run.

VIM has another great feature that enable us to Turn Off or Turn On syntax highlighting using option syntax on and syntax off.

How to Install VIM

Most of the Linux system already included VIM package, if not then install it using YUM tool.
# yum -y install vim-enhanced

How to Enable Syntax Highlighting in VI and VIM

To enable Syntax Highlighting feature in VI editor, open the file called /etc/profile.

      ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
                                                    ► Read more: http://adf.ly/1n602F
      ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬

No comments:

Post a Comment