You are not logged in.

#1 2021-02-01 13:32:56

Snubbi
Member
From: Denmark
Registered: 2020-05-23
Posts: 13

Set nano as the default editor on the entire system

How do I do it? No matter if I want to change files in Midnight Commander and save it with nano command, or put something up in crontab with nano.


"Do not judge me by my successes, judge me by how many times I fell down and got back up again." - Nelson Mandela

Offline

#2 2021-02-01 13:48:04

Lone_Wolf
Forum Moderator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,982

Re: Set nano as the default editor on the entire system

for cli applications like MC, environment variables can be used to set such things, see https://wiki.archlinux.org/index.php/En … t_programs

For graphical applications things are more complicated, https://wiki.archlinux.org/index.php/De … plications


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#3 2021-02-01 14:37:11

seth
Member
Registered: 2012-09-03
Posts: 51,945

Re: Set nano as the default editor on the entire system

mc also defaults to it's internal editor which you'll have to uncheck in the config dialog.

Offline

#4 2021-02-01 15:49:56

shulamy
Member
From: israel
Registered: 2010-09-11
Posts: 458

Re: Set nano as the default editor on the entire system

or set mc default editor to nano

ezik

Offline

#5 2021-02-01 17:54:13

archimboldo
Member
Registered: 2016-03-07
Posts: 232

Re: Set nano as the default editor on the entire system

Or modify mc.ext with the following at the end of the file...

# Default target for anything not described above
default/*
        Open=
        View=
        Edit=nano

Last edited by archimboldo (2021-02-01 18:03:24)


Rules for problems.
Everyone has problems. Animals have problems. And buildings. And cats, and trees.
Problems are your friends. Treat them well.

Offline

#6 2021-02-02 07:37:17

Snubbi
Member
From: Denmark
Registered: 2020-05-23
Posts: 13

Re: Set nano as the default editor on the entire system

Can it not be done by inserting the following in etc/profile

export VISUAL="nano"
export EDITOR="nano"

so the file looks like this

# /etc/profile

# Set our umask
umask 022

# Append "$1" to $PATH when not already in.
# This function API is accessible to scripts in /etc/profile.d
append_path () {
    case ":$PATH:" in
        *:"$1":*)
            ;;
        *)
            PATH="${PATH:+$PATH:}$1"
    esac
}

# Append our default paths
append_path '/usr/local/sbin'
append_path '/usr/local/bin'
append_path '/usr/bin'

# Force PATH to be environment
export PATH

# Load profiles from /etc/profile.d
if test -d /etc/profile.d/; then
	for profile in /etc/profile.d/*.sh; do
		test -r "$profile" && . "$profile"
	done
	unset profile
fi

# Unload our profile API functions
unset -f append_path

# Source global bash config, when interactive but not posix or sh mode
if test "$BASH" &&\
   test "$PS1" &&\
   test -z "$POSIXLY_CORRECT" &&\
   test "${0#-}" != sh &&\
   test -r /etc/bash.bashrc
then
	. /etc/bash.bashrc
fi

export VISUAL="nano"
export EDITOR="nano"

# Termcap is outdated, old, and crusty, kill it.
unset TERMCAP

# Man is much better than us at figuring this out
unset MANPATH

"Do not judge me by my successes, judge me by how many times I fell down and got back up again." - Nelson Mandela

Offline

#7 2021-02-02 07:42:19

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,844

Re: Set nano as the default editor on the entire system

That's what you'd want to do yes. You just have to additionally disable the internal editor as otherwise mc doesn't check those variables.

Offline

Board footer

Powered by FluxBB