{"id":1081,"date":"2015-07-20T13:20:07","date_gmt":"2015-07-20T11:20:07","guid":{"rendered":"https:\/\/www.nullalo.com\/?p=1081"},"modified":"2025-10-22T10:16:31","modified_gmt":"2025-10-22T08:16:31","slug":"linux-come-cambiare-leditor-predefinito","status":"publish","type":"post","link":"https:\/\/www.nullalo.com\/en\/linux-how-to-change-default-editor\/","title":{"rendered":"Linux: how to change default editor"},"content":{"rendered":"<p>Sometimes Linux default editor (usually &#8220;you&#8221; or &#8220;vim&#8221;) is not the most comfortable, especially for users that often\u00a0use\u00a0other editors like &#8220;nano&#8221;.<\/p>\n<p>There are several online tutorials on how to change the default editor, but those\u00a0procedures are often wrong and we realize that when, for example, we try to edit crontab (with the command crontab -e) and the old editor still come up.<\/p>\n<p>In this article we will see how to change Linux default editor globally, or only for\u00a0a specific user.<\/p>\n<h4 style=\"text-align: justify;\">Editor installation<\/h4>\n<p style=\"text-align: justify;\">The first thing to do of course is to install, if not already present, the new editor (eg. &#8220;nano&#8221;), with the following command:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">yum install nano (for CentOs\/Redhat-based Linux distributions)\r\napt-get install nano (for Debian\/Ubuntu-based Linux distributions)<\/pre>\n<p style=\"text-align: justify;\">At this point you have two options:<\/p>\n<h4 style=\"text-align: justify;\">1. Set the default editor for a single user profile<\/h4>\n<p style=\"text-align: justify;\">You\u00a0will simply have to edit <strong>.bash_profile<\/strong> file of your profile (eg .: \/root\/.bash_profile or \/home\/nullalo\/.bash_profile, or generally ~\/.bash.profile for currently logged in profile) and add\u00a0the following lines:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">export VISUAL=&quot;nano&quot;\r\nexport EDITOR=&quot;nano&quot;<\/pre>\n<h4 style=\"text-align: justify;\">2. Set the default editor globally<\/h4>\n<p style=\"text-align: justify;\">In this case you will have to edit <strong>\/etc\/bashrc<\/strong> file and add\u00a0(possibly at the end of it) the following lines:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">export VISUAL=&quot;nano&quot;\r\nexport EDITOR=&quot;nano&quot;<\/pre>\n<h4 style=\"text-align: justify;\">Final check<\/h4>\n<p style=\"text-align: justify;\">To make sure everything is ok, you need to disconnect and reconnect your user and ensure that with the following command:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">crontab -e<\/pre>\n<p style=\"text-align: justify;\">new editor is used\u00a0(in our case &#8220;nano&#8221;) in place of the old one (eg.: &#8220;vi&#8221;).<\/p>\n<h4 style=\"text-align: justify;\">Remarks<\/h4>\n<p style=\"text-align: justify;\">Remember that the <strong>local editor<\/strong>, that is the one\u00a0specified for a single profile, <strong>always overrides\u00a0the global one<\/strong>: therefore, if you set &#8220;nano&#8221; in \/etc\/bashrc file and &#8220;vi&#8221; in the ~\/.bash_profile file, your profile will use\u00a0&#8220;vi&#8221; as editor,\u00a0and not &#8220;nano&#8221;.<\/p>\n<p style=\"text-align: justify;\">The <strong>difference between the environment variables VISUAL and EDITOR<\/strong>\u00a0is that EDITOR should be able to operate without the use of &#8220;advanced&#8221; terminal capabilities, while VISUAL may be a full screen editor such as vi or emacs. If you call an editor via bash, it will first try to use the editor defined in VISUAL, and in case of failure (maybe because terminal does not support a full-screen editor) it will use the editor defined in the variable EDITOR. The advice is to set EDITOR to the value &#8220;vi -e&#8221;.<\/p>\n<p><\/p>","protected":false},"excerpt":{"rendered":"<p>Sometimes Linux default editor (usually &#8220;you&#8221; or &#8220;vim&#8221;) is not the most comfortable, especially for users that often\u00a0use\u00a0other editors like &#8220;nano&#8221;. There are several online tutorials on how to change the default editor, but those\u00a0procedures are often wrong and we realize that when, for example, we try to edit crontab<\/p>\n","protected":false},"author":2,"featured_media":1085,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[4],"tags":[],"class_list":["post-1081","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-reviews"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Linux: how to change default editor - Nullalo!<\/title>\n<meta name=\"description\" content=\"In this article we will see how to change Linux default editor globally, or only for a specific user.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.nullalo.com\/?p=1081\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Linux: how to change default editor - Nullalo!\" \/>\n<meta property=\"og:description\" content=\"[:it]In questo articolo vedremo come cambiare l&#039;editor predefinito di Linux globalmente, o solo per uno specifico utente.[:en]In this article we will see how to change Linux default editor globally, or only for a specific user.[:]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.nullalo.com\/?p=1081\" \/>\n<meta property=\"og:site_name\" content=\"Nullalo!\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/nullalo\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/fulvio.sicurezza\" \/>\n<meta property=\"article:published_time\" content=\"2015-07-20T11:20:07+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-10-22T08:16:31+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.nullalo.com\/wp-content\/uploads\/2015\/07\/linux_editor.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1140\" \/>\n\t<meta property=\"og:image:height\" content=\"600\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Fulvio Sicurezza\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/FulvioSicurezza\" \/>\n<meta name=\"twitter:site\" content=\"@Nullalo\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Fulvio Sicurezza\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.nullalo.com\/?p=1081\",\"url\":\"https:\/\/www.nullalo.com\/?p=1081\",\"name\":\"[:it]Linux: come cambiare l'editor predefinito[:en]Linux: how to change default editor[:] - Nullalo!\",\"isPartOf\":{\"@id\":\"https:\/\/www.nullalo.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.nullalo.com\/?p=1081#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.nullalo.com\/?p=1081#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.nullalo.com\/wp-content\/uploads\/2015\/07\/linux_editor.jpg\",\"datePublished\":\"2015-07-20T11:20:07+00:00\",\"dateModified\":\"2025-10-22T08:16:31+00:00\",\"author\":{\"@id\":\"https:\/\/www.nullalo.com\/#\/schema\/person\/fe9c2885376a6ab076e06461ae1b546c\"},\"description\":\"[:it]In questo articolo vedremo come cambiare l'editor predefinito di Linux globalmente, o solo per uno specifico utente.[:en]In this article we will see how to change Linux default editor globally, or only for a specific user.[:]\",\"breadcrumb\":{\"@id\":\"https:\/\/www.nullalo.com\/?p=1081#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.nullalo.com\/?p=1081\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.nullalo.com\/?p=1081#primaryimage\",\"url\":\"https:\/\/www.nullalo.com\/wp-content\/uploads\/2015\/07\/linux_editor.jpg\",\"contentUrl\":\"https:\/\/www.nullalo.com\/wp-content\/uploads\/2015\/07\/linux_editor.jpg\",\"width\":1140,\"height\":600},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.nullalo.com\/?p=1081#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.nullalo.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Linux: come cambiare l&#8217;editor predefinito\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.nullalo.com\/#website\",\"url\":\"https:\/\/www.nullalo.com\/\",\"name\":\"Nullalo!\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.nullalo.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.nullalo.com\/#\/schema\/person\/fe9c2885376a6ab076e06461ae1b546c\",\"name\":\"Fulvio Sicurezza\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.nullalo.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/www.nullalo.com\/wp-content\/uploads\/2015\/02\/Fulvio-Sicurezza_avatar_1424711147-96x96.jpg\",\"contentUrl\":\"https:\/\/www.nullalo.com\/wp-content\/uploads\/2015\/02\/Fulvio-Sicurezza_avatar_1424711147-96x96.jpg\",\"caption\":\"Fulvio Sicurezza\"},\"sameAs\":[\"http:\/\/www.generalservice.na.it\",\"https:\/\/www.facebook.com\/fulvio.sicurezza\",\"http:\/\/it.linkedin.com\/in\/fulviosicurezza\",\"https:\/\/x.com\/https:\/\/twitter.com\/FulvioSicurezza\",\"https:\/\/www.youtube.com\/c\/FulvioSicurezzaIT\"],\"url\":\"https:\/\/www.nullalo.com\/en\/author\/f-sicurezza\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Linux: how to change default editor - Nullalo!","description":"In this article we will see how to change Linux default editor globally, or only for a specific user.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.nullalo.com\/?p=1081","og_locale":"en_US","og_type":"article","og_title":"Linux: how to change default editor - Nullalo!","og_description":"[:it]In questo articolo vedremo come cambiare l'editor predefinito di Linux globalmente, o solo per uno specifico utente.[:en]In this article we will see how to change Linux default editor globally, or only for a specific user.[:]","og_url":"https:\/\/www.nullalo.com\/?p=1081","og_site_name":"Nullalo!","article_publisher":"https:\/\/www.facebook.com\/nullalo","article_author":"https:\/\/www.facebook.com\/fulvio.sicurezza","article_published_time":"2015-07-20T11:20:07+00:00","article_modified_time":"2025-10-22T08:16:31+00:00","og_image":[{"width":1140,"height":600,"url":"https:\/\/www.nullalo.com\/wp-content\/uploads\/2015\/07\/linux_editor.jpg","type":"image\/jpeg"}],"author":"Fulvio Sicurezza","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/FulvioSicurezza","twitter_site":"@Nullalo","twitter_misc":{"Written by":"Fulvio Sicurezza","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.nullalo.com\/?p=1081","url":"https:\/\/www.nullalo.com\/?p=1081","name":"[:it]Linux: come cambiare l'editor predefinito[:en]Linux: how to change default editor[:] - Nullalo!","isPartOf":{"@id":"https:\/\/www.nullalo.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.nullalo.com\/?p=1081#primaryimage"},"image":{"@id":"https:\/\/www.nullalo.com\/?p=1081#primaryimage"},"thumbnailUrl":"https:\/\/www.nullalo.com\/wp-content\/uploads\/2015\/07\/linux_editor.jpg","datePublished":"2015-07-20T11:20:07+00:00","dateModified":"2025-10-22T08:16:31+00:00","author":{"@id":"https:\/\/www.nullalo.com\/#\/schema\/person\/fe9c2885376a6ab076e06461ae1b546c"},"description":"[:it]In questo articolo vedremo come cambiare l'editor predefinito di Linux globalmente, o solo per uno specifico utente.[:en]In this article we will see how to change Linux default editor globally, or only for a specific user.[:]","breadcrumb":{"@id":"https:\/\/www.nullalo.com\/?p=1081#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.nullalo.com\/?p=1081"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.nullalo.com\/?p=1081#primaryimage","url":"https:\/\/www.nullalo.com\/wp-content\/uploads\/2015\/07\/linux_editor.jpg","contentUrl":"https:\/\/www.nullalo.com\/wp-content\/uploads\/2015\/07\/linux_editor.jpg","width":1140,"height":600},{"@type":"BreadcrumbList","@id":"https:\/\/www.nullalo.com\/?p=1081#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.nullalo.com\/"},{"@type":"ListItem","position":2,"name":"Linux: come cambiare l&#8217;editor predefinito"}]},{"@type":"WebSite","@id":"https:\/\/www.nullalo.com\/#website","url":"https:\/\/www.nullalo.com\/","name":"Nullalo!","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.nullalo.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.nullalo.com\/#\/schema\/person\/fe9c2885376a6ab076e06461ae1b546c","name":"Fulvio Sicurezza","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.nullalo.com\/#\/schema\/person\/image\/","url":"https:\/\/www.nullalo.com\/wp-content\/uploads\/2015\/02\/Fulvio-Sicurezza_avatar_1424711147-96x96.jpg","contentUrl":"https:\/\/www.nullalo.com\/wp-content\/uploads\/2015\/02\/Fulvio-Sicurezza_avatar_1424711147-96x96.jpg","caption":"Fulvio Sicurezza"},"sameAs":["http:\/\/www.generalservice.na.it","https:\/\/www.facebook.com\/fulvio.sicurezza","http:\/\/it.linkedin.com\/in\/fulviosicurezza","https:\/\/x.com\/https:\/\/twitter.com\/FulvioSicurezza","https:\/\/www.youtube.com\/c\/FulvioSicurezzaIT"],"url":"https:\/\/www.nullalo.com\/en\/author\/f-sicurezza\/"}]}},"_links":{"self":[{"href":"https:\/\/www.nullalo.com\/en\/wp-json\/wp\/v2\/posts\/1081","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.nullalo.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.nullalo.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.nullalo.com\/en\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.nullalo.com\/en\/wp-json\/wp\/v2\/comments?post=1081"}],"version-history":[{"count":1,"href":"https:\/\/www.nullalo.com\/en\/wp-json\/wp\/v2\/posts\/1081\/revisions"}],"predecessor-version":[{"id":1949,"href":"https:\/\/www.nullalo.com\/en\/wp-json\/wp\/v2\/posts\/1081\/revisions\/1949"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.nullalo.com\/en\/wp-json\/wp\/v2\/media\/1085"}],"wp:attachment":[{"href":"https:\/\/www.nullalo.com\/en\/wp-json\/wp\/v2\/media?parent=1081"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.nullalo.com\/en\/wp-json\/wp\/v2\/categories?post=1081"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.nullalo.com\/en\/wp-json\/wp\/v2\/tags?post=1081"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}