{"id":898,"date":"2022-01-25T02:29:55","date_gmt":"2022-01-24T20:59:55","guid":{"rendered":"https:\/\/mutesoft.com\/spaces\/software\/?p=898"},"modified":"2022-04-19T13:43:53","modified_gmt":"2022-04-19T08:13:53","slug":"vi-show-line-numbers","status":"publish","type":"post","link":"https:\/\/mutesoft.com\/spaces\/software\/vi-show-line-numbers.html","title":{"rendered":"vi Show Line Numbers"},"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\/vi-show-line-numbers.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\/vi-show-line-numbers.html\/#2_Temporarily_Show_Line_Numbers_in_vi\" >2. Temporarily Show Line Numbers in vi<\/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\/vi-show-line-numbers.html\/#3_Permanently_Show_Line_Numbers_in_vi\" >3. Permanently Show Line Numbers in vi<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/mutesoft.com\/spaces\/software\/vi-show-line-numbers.html\/#4_Conclusion\" >4. 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 <code>vi<\/code> editor commands is absolute bliss. You can get your work done much faster with frequently used commands. In this article, I\u2019ll share the commands to show line numbers in the <code>vi<\/code> editor temporarily for a single session, and permanently as well.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"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><\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"2_Temporarily_Show_Line_Numbers_in_vi\"><\/span>2. Temporarily Show Line Numbers in vi<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>To temporarily show line numbers in <code>vi<\/code> editor, in command mode type <code>:set number<\/code> or <code>:set nu<\/code>. To temporarily hide line numbers, in command mode type <code>:set nonumber<\/code> or <code>:set nonu<\/code>.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\" data-enlighter-theme=\"dracula\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"># Switch to command mode\nEsc\n# Show line numbers\n:set number\n# Alternate option to show line numbers\n:set nu\n# Hide line numbers\n:set nonumber\n# Alternate option to hide line numbers\n:set nonu<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"3_Permanently_Show_Line_Numbers_in_vi\"><\/span>3. Permanently Show Line Numbers in vi<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>To permanently show line numbers in <code>vi<\/code> editor, edit the file <code>~\/.vimrc<\/code> and add the option <code>:set number<\/code> or <code>:set nu<\/code> at the end.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\" 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 show line numbers\n:set number\n# Add alternate option to show line numbers\n:set nu\n# Add option to hide line numbers (default behavior)\n:set nonumber\n# Add alternate option to hide line numbers (default behavior)\n:set nonu<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"4_Conclusion\"><\/span>4. Conclusion<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>In this article, you have learned how to show line numbers in the <code>vi<\/code> editor temporarily for a single session or permanently. 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>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Knowing the commonly used vi editor commands is absolute bliss. You can get your work done much faster with frequently used commands. In this article, I&#8217;ll share the commands to show line numbers in the vi editor temporarily for a single session, and permanently as well.<\/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":"Knowing the commonly used vi editor commands is absolute bliss. You can get your work done much faster with frequently used commands. In this article, I&#039;ll share the commands to show line numbers in the vi editor temporarily for a single session, and permanently as well.","_seopress_robots_index":"","_vp_format_video_url":"","_vp_image_focal_point":[],"footnotes":""},"categories":[6,32],"tags":[46,47,42,43],"class_list":["post-898","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\/898","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=898"}],"version-history":[{"count":21,"href":"https:\/\/mutesoft.com\/spaces\/software\/wp-json\/wp\/v2\/posts\/898\/revisions"}],"predecessor-version":[{"id":1151,"href":"https:\/\/mutesoft.com\/spaces\/software\/wp-json\/wp\/v2\/posts\/898\/revisions\/1151"}],"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=898"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mutesoft.com\/spaces\/software\/wp-json\/wp\/v2\/categories?post=898"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mutesoft.com\/spaces\/software\/wp-json\/wp\/v2\/tags?post=898"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}