{"id":1488,"date":"2021-08-28T06:33:23","date_gmt":"2021-08-28T06:33:23","guid":{"rendered":"https:\/\/ownwebservers.com\/kb\/?p=1488"},"modified":"2021-08-30T12:26:44","modified_gmt":"2021-08-30T12:26:44","slug":"1488","status":"publish","type":"post","link":"https:\/\/ownwebservers.com\/kb\/1488\/","title":{"rendered":"Changing the Default Text Editor in Linux"},"content":{"rendered":"<p>A default text editor comes with several Linux distributions. Like nano, vim, ed etc. Users will change it according with their preferences by ever-changing the $EDITOR atmosphere variable.<\/p>\n<h2><strong>Below is the explaination for for changing default editor from nano to vim.<\/strong><\/h2>\n<p>Then open the <strong>.bashrc file<\/strong> and add the line as shown below.<\/p>\n<blockquote><p>#FILE: .bashrc<\/p>\n<p>export EDITOR=\u201dvim\u201d<\/p><\/blockquote>\n<p>Different instruction applications alike the crontab, svn and visudo make use of the $EDITOR variable to decide on the default text editor.<\/p>\n<p>How to change default text editor in Ubuntu<\/p>\n<p>In an operating system like Ubuntu, you would need to use a script inorder to vary the default text editor called the update-alternatives. Below is that the description of howr you&#8217;ll be able to approach doing it.<\/p>\n<p>Now in your terminal, enter the below command :<\/p>\n<blockquote><p><strong>$ sudo update-alternatives \u2013config editor<\/strong><\/p><\/blockquote>\n<p>&nbsp;<\/p>\n<p>You may also do that by work in as root to avoid using sudo to run the command. You then be prompted for password, getting into the right password you&#8217;d be presented with a list of console text editors found on your system. You will be able to select between them and change it to using as a default text editor.<\/p>\n<blockquote><p><strong>[sudo] password for yourserver : *****<\/strong><\/p><\/blockquote>\n<p>There are 3 alternatives which provide `editor\u2019.<\/p>\n<p>Selection Alternative<\/p>\n<blockquote><p>1 \/usr\/bin\/vim.tiny<\/p>\n<p>2 \/bin\/ed<\/p>\n<p>*+ 3 \/bin\/nano<\/p>\n<p>Press enter to keep the default[*], or type selection number: 1<\/p><\/blockquote>\n<p>Additionally, you are able to change the default text editor and apply it all across the system (for all users) or select to change it for a particular user. Below is the step for the same :<\/p>\n<p><strong>A.<\/strong><strong>\u00a0System Wide<\/strong><\/p>\n<p>Run the following command and choose the one of your choice<\/p>\n<blockquote><p>$\u00a0sudo update-alternatives \u2013config editor<\/p><\/blockquote>\n<p><strong>B. User Level<\/strong><\/p>\n<p>A server admin who only wishes to change the text editor for particular users or, If you are a user with limited privileges, you can add an alias for editor to for example vim.<\/p>\n<p>For these, you must Open and edit <strong>~\/.bashrc<\/strong> with adding <strong>alias editor=vim<\/strong><\/p>\n<p>You can test it now. Once you open a bash prompt, you\u2019ll see that the editor has changed according to your preference that you have selected.<\/p>\n<p>If you need any help with this, please feel free to contact our technical support department via. online chat available at our website OR raise a ticket stating your requirements with the preferred text editor.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A default text editor comes with several Linux distributions. Like nano, vim, ed etc. Users will change it according with their preferences by ever-changing the $EDITOR atmosphere variable. Below is the explaination for for changing default editor from nano to vim. Then open the .bashrc file and add the line as shown below. #FILE: .bashrc [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[23],"tags":[],"class_list":["post-1488","post","type-post","status-publish","format-standard","hentry","category-tutorials"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v15.2.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Changing the Default Text Editor in Linux - OWS KB<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/ownwebservers.com\/kb\/1488\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Changing the Default Text Editor in Linux - OWS KB\" \/>\n<meta property=\"og:description\" content=\"A default text editor comes with several Linux distributions. Like nano, vim, ed etc. Users will change it according with their preferences by ever-changing the $EDITOR atmosphere variable. Below is the explaination for for changing default editor from nano to vim. Then open the .bashrc file and add the line as shown below. #FILE: .bashrc [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/ownwebservers.com\/kb\/1488\/\" \/>\n<meta property=\"og:site_name\" content=\"OWS KB\" \/>\n<meta property=\"article:published_time\" content=\"2021-08-28T06:33:23+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-08-30T12:26:44+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\">\n\t<meta name=\"twitter:data1\" content=\"admin\">\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\">\n\t<meta name=\"twitter:data2\" content=\"2 minutes\">\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/ownwebservers.com\/kb\/#website\",\"url\":\"https:\/\/ownwebservers.com\/kb\/\",\"name\":\"OWS KB\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":\"https:\/\/ownwebservers.com\/kb\/?s={search_term_string}\",\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/ownwebservers.com\/kb\/1488\/#webpage\",\"url\":\"https:\/\/ownwebservers.com\/kb\/1488\/\",\"name\":\"Changing the Default Text Editor in Linux - OWS KB\",\"isPartOf\":{\"@id\":\"https:\/\/ownwebservers.com\/kb\/#website\"},\"datePublished\":\"2021-08-28T06:33:23+00:00\",\"dateModified\":\"2021-08-30T12:26:44+00:00\",\"author\":{\"@id\":\"https:\/\/ownwebservers.com\/kb\/#\/schema\/person\/4a40fe3fe17a08ddd1d7c113668e75f2\"},\"breadcrumb\":{\"@id\":\"https:\/\/ownwebservers.com\/kb\/1488\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/ownwebservers.com\/kb\/1488\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/ownwebservers.com\/kb\/1488\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"item\":{\"@type\":\"WebPage\",\"@id\":\"https:\/\/ownwebservers.com\/kb\/\",\"url\":\"https:\/\/ownwebservers.com\/kb\/\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"position\":2,\"item\":{\"@type\":\"WebPage\",\"@id\":\"https:\/\/ownwebservers.com\/kb\/1488\/\",\"url\":\"https:\/\/ownwebservers.com\/kb\/1488\/\",\"name\":\"Changing the Default Text Editor in Linux\"}}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/ownwebservers.com\/kb\/#\/schema\/person\/4a40fe3fe17a08ddd1d7c113668e75f2\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/ownwebservers.com\/kb\/#personlogo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/ba5db5841d48bd7517bb2583e13983e6d2fa56a4099a0b3c61ad2daefc321303?s=96&d=mm&r=g\",\"caption\":\"admin\"},\"sameAs\":[\"https:\/\/ownwebservers.com\/kb\"]}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","_links":{"self":[{"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/posts\/1488","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/comments?post=1488"}],"version-history":[{"count":5,"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/posts\/1488\/revisions"}],"predecessor-version":[{"id":1520,"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/posts\/1488\/revisions\/1520"}],"wp:attachment":[{"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/media?parent=1488"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/categories?post=1488"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/tags?post=1488"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}