CentosLinux

How to Set Nano as Default Editor on CentOS 7

1 Mins read

How to Set Default Editor to Nano on CentOS 7 – Not everyone is familiar with the “vim” text editor. Its many shortcuts are also not easy to memorize. One of the most commonly used text editors is nano, but in the CentOS 7 standard installation, nano is not yet a standard text editor. Therefore, follow the steps below to make nano as a standard text editor, so that it will be easier for us to do editing, for example, to edit crontab

Install nano

Execute command below to install nano

yum -y install nano

Disable Word Wrap

Nano by default enables word wrap. While nice in a normal document, this is generally undesirable in a configuration file

echo "set nowrap" >>/etc/nanorc

Set System Default Editor

During login, a number of scripts are run to setup the environment. In CentOS, a file for each subject is used. These are stored in a system profile directory, /etc/profile.d/. There are two environment variables that control which editor to use.

cat <>/etc/profile.d/nano.sh
export VISUAL="nano"
export EDITOR="nano"
EOF

Set Per User Default

If a user wishes to set the default editor for themselves, it can be, instead, be done in the user’s bash profile.

cat <>~/.bash_profile
export VISUAL="nano"
export EDITOR="nano"
EOF

Try

Try by opening crontab. execute commnad below

crontab -e

If it opened in nano, so, those steps is right..Try to logout and then login again if still fail

Thats is steps to Set Nano as Default Editor on CentOS 7, if you want to install Percona on Centos 7, please follow this link

Related posts
Linux

Vim Keyboard Shortcut (or Vi) You Should Memorize

3 Mins read
Vim Keyboard Shortcut – The Vim editor is a command-line based tool that’s an enhanced version of the venerable vi editor. Despite…
CentosLinux

Semanage : Command Not Found in CentOS 7

1 Mins read
Semanage is an SELinux (Security-Enhanced Linux) management tool that is used to configure specific elements without making any adjustments to or reassembling…
CentosLinux

Install Nextcloud on CentOS 7 + Setting Let’s Encrypt SSL

3 Mins read
Install Nextcloud on CentOS 7 – This guide will walk you through the installation of Nextcloud on CentOS 7 with PHP 7.3,…

Leave a Reply

Your email address will not be published. Required fields are marked *