vim Syntax Highlighting

1. Context

Knowing the commonly used vim editor commands is absolute bliss. You can get your work done much faster with frequently used commands. The syntax highlighting feature of text editors marks keywords, operators, numbers, strings, etc. differently according to the programming language constructs. For developers, modern IDEs offer syntax highlighting. In this article, I’ll share the configuration to enable syntax highlighting in both vi and vim editors.



vi editor on Mac
vi editor on Mac

2. Enable Syntax Highlighting in vi and vim

To permanently enable syntax highlighting in vim and vi editors, open the file ~/.vimrc and add the configuration syntax on.



# Open ~/.vimrc in vi editor
vi ~/.vimrc
# Add option to enable syntax highlighting
syntax on

3. Conclusion

In this article, you have learned how to enable syntax highlighting in the vim and vi editors. To work with the vi editor like a pro, refer to this article: Work With vi Editor Like a Pro. To know how to go to a specific line in vi editor, refer to this article: vi Show Line Numbers.

vim Syntax Highlighting
Be The First

Join our list to get instant access to new articles and weekly newsletter.

Tagged on:             
0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x