{"id":903,"date":"2022-01-25T02:51:34","date_gmt":"2022-01-24T21:21:34","guid":{"rendered":"https:\/\/mutesoft.com\/spaces\/software\/?p=903"},"modified":"2022-08-18T09:12:59","modified_gmt":"2022-08-18T03:42:59","slug":"vim-syntax-highlighting","status":"publish","type":"post","link":"https:\/\/mutesoft.com\/spaces\/software\/vim-syntax-highlighting.html","title":{"rendered":"vim Syntax Highlighting"},"content":{"rendered":"\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_79_2 counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\"><p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<\/div><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/mutesoft.com\/spaces\/software\/vim-syntax-highlighting.html\/#1_Context\" >1. Context<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/mutesoft.com\/spaces\/software\/vim-syntax-highlighting.html\/#2_Enable_Syntax_Highlighting_in_vi_and_vim\" >2. Enable Syntax Highlighting in vi and vim<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/mutesoft.com\/spaces\/software\/vim-syntax-highlighting.html\/#3_Conclusion\" >3. Conclusion<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"1_Context\"><\/span>1. Context<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>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\u2019ll share the configuration to enable syntax highlighting in both <code>vi<\/code> and <code>vim<\/code> editors.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full is-resized\"><img decoding=\"async\" src=\"https:\/\/mutesoft.com\/spaces\/software\/wp-content\/uploads\/sites\/7\/2022\/01\/vi-editor.png\" alt=\"vi editor on Mac\" class=\"wp-image-881\" width=\"1200\" srcset=\"https:\/\/mutesoft.com\/spaces\/software\/wp-content\/uploads\/sites\/7\/2022\/01\/vi-editor.png 1008w, https:\/\/mutesoft.com\/spaces\/software\/wp-content\/uploads\/sites\/7\/2022\/01\/vi-editor-300x188.png 300w, https:\/\/mutesoft.com\/spaces\/software\/wp-content\/uploads\/sites\/7\/2022\/01\/vi-editor-768x480.png 768w\" sizes=\"(max-width: 1008px) 100vw, 1008px\" \/><figcaption>vi editor on Mac<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"2_Enable_Syntax_Highlighting_in_vi_and_vim\"><\/span>2. Enable Syntax Highlighting in vi and vim<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>To permanently enable syntax highlighting in <code>vim<\/code> and <code>vi<\/code> editors, open the file <code>~\/.vimrc<\/code> and add the configuration <code>syntax on<\/code>.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"dracula\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"># Open ~\/.vimrc in vi editor\nvi ~\/.vimrc\n# Add option to enable syntax highlighting\nsyntax on<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"3_Conclusion\"><\/span>3. Conclusion<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>In this article, you have learned how to enable syntax highlighting in the <code>vim<\/code> and <code>vi<\/code> editors. To work with the <code>vi<\/code> editor like a pro, refer to this article: <a href=\"https:\/\/mutesoft.com\/spaces\/software\/work-with-vi-editor-like-a-pro.html\">Work With vi Editor Like a Pro<\/a>. To know how to go to a specific line in <code>vi<\/code> editor, refer to this article: <a href=\"https:\/\/mutesoft.com\/spaces\/software\/vi-show-line-numbers.html\">vi Show Line Numbers<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The syntax highlighting feature of text editors mark keywords, operators, numbers, string, etc. differently according to the programming language constructs. For developers, modern IDEs offer syntax highlighting.<\/p>\n","protected":false},"author":2,"featured_media":881,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_seopress_robots_primary_cat":"none","_seopress_titles_title":"","_seopress_titles_desc":"The syntax highlighting feature of text editors mark keywords, operators, numbers, string, etc. differently according to the programming language constructs. For developers, modern IDEs offer syntax highlighting.","_seopress_robots_index":"","_vp_format_video_url":"","_vp_image_focal_point":[],"footnotes":""},"categories":[6,32],"tags":[46,47,42,43],"class_list":["post-903","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-programming","category-tools","tag-top-vi-commands","tag-top-vim-commands","tag-vi-editor","tag-vim-editor"],"_links":{"self":[{"href":"https:\/\/mutesoft.com\/spaces\/software\/wp-json\/wp\/v2\/posts\/903","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mutesoft.com\/spaces\/software\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mutesoft.com\/spaces\/software\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mutesoft.com\/spaces\/software\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/mutesoft.com\/spaces\/software\/wp-json\/wp\/v2\/comments?post=903"}],"version-history":[{"count":23,"href":"https:\/\/mutesoft.com\/spaces\/software\/wp-json\/wp\/v2\/posts\/903\/revisions"}],"predecessor-version":[{"id":1181,"href":"https:\/\/mutesoft.com\/spaces\/software\/wp-json\/wp\/v2\/posts\/903\/revisions\/1181"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/mutesoft.com\/spaces\/software\/wp-json\/wp\/v2\/media\/881"}],"wp:attachment":[{"href":"https:\/\/mutesoft.com\/spaces\/software\/wp-json\/wp\/v2\/media?parent=903"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mutesoft.com\/spaces\/software\/wp-json\/wp\/v2\/categories?post=903"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mutesoft.com\/spaces\/software\/wp-json\/wp\/v2\/tags?post=903"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}