{"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"],"_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}]}}