Where is the editor choice kept in ranger?
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
On a fresh ranger
install I tried to open neofetch
config with ranger
and selected ed
to see what is it. I am glad Ctrl+D worked to exit the ed
, but now ranger
opens all files with it. Restarting terminal didn't work. ~/.config/ranger
is empty:
$ ls -la .config/ranger/
total 12
drwxr-xr-x 2 techtonik techtonik 4096 ліс 24 23:32 .
drwx------ 24 techtonik techtonik 4096 ліс 24 22:19 ..
-rw-r--r-- 1 techtonik techtonik 35 ліс 24 23:32 bookmarks
-rw-r--r-- 1 techtonik techtonik 0 ліс 24 23:32 history
-rw-r--r-- 1 techtonik techtonik 0 ліс 7 14:03 tagged
How to fix that?
UPD: $EDITOR
is empty, rifle
still runs the ed
.
$ rifle -l ~/.config/neofetch/config.conf
0:editor::$EDITOR -- "$@"
1:pager::"$PAGER" -- "$@"
$ echo $EDITOR
$ rifle ~/.config/neofetch/config.conf
13949
UPD2: Ubuntu 18.10
UPD3: I don't see that ed
is selected by OS
$ update-alternatives --display editor
editor - auto mode
link best version is /bin/nano
link currently points to /bin/nano
link editor is /usr/bin/editor
slave editor.1.gz is /usr/share/man/man1/editor.1.gz
slave editor.fr.1.gz is /usr/share/man/fr/man1/editor.1.gz
slave editor.it.1.gz is /usr/share/man/it/man1/editor.1.gz
slave editor.ja.1.gz is /usr/share/man/ja/man1/editor.1.gz
slave editor.pl.1.gz is /usr/share/man/pl/man1/editor.1.gz
slave editor.ru.1.gz is /usr/share/man/ru/man1/editor.1.gz
/bin/ed - priority -100
slave editor.1.gz: /usr/share/man/man1/ed.1.gz
/bin/nano - priority 40
slave editor.1.gz: /usr/share/man/man1/nano.1.gz
/usr/bin/vim.basic - priority 30
slave editor.1.gz: /usr/share/man/man1/vim.1.gz
slave editor.fr.1.gz: /usr/share/man/fr/man1/vim.1.gz
slave editor.it.1.gz: /usr/share/man/it/man1/vim.1.gz
slave editor.ja.1.gz: /usr/share/man/ja/man1/vim.1.gz
slave editor.pl.1.gz: /usr/share/man/pl/man1/vim.1.gz
slave editor.ru.1.gz: /usr/share/man/ru/man1/vim.1.gz
/usr/bin/vim.tiny - priority 15
slave editor.1.gz: /usr/share/man/man1/vim.1.gz
slave editor.fr.1.gz: /usr/share/man/fr/man1/vim.1.gz
slave editor.it.1.gz: /usr/share/man/it/man1/vim.1.gz
slave editor.ja.1.gz: /usr/share/man/ja/man1/vim.1.gz
slave editor.pl.1.gz: /usr/share/man/pl/man1/vim.1.gz
slave editor.ru.1.gz: /usr/share/man/ru/man1/vim.1.gz
ubuntu alternatives ranger ed
add a comment |
up vote
0
down vote
favorite
On a fresh ranger
install I tried to open neofetch
config with ranger
and selected ed
to see what is it. I am glad Ctrl+D worked to exit the ed
, but now ranger
opens all files with it. Restarting terminal didn't work. ~/.config/ranger
is empty:
$ ls -la .config/ranger/
total 12
drwxr-xr-x 2 techtonik techtonik 4096 ліс 24 23:32 .
drwx------ 24 techtonik techtonik 4096 ліс 24 22:19 ..
-rw-r--r-- 1 techtonik techtonik 35 ліс 24 23:32 bookmarks
-rw-r--r-- 1 techtonik techtonik 0 ліс 24 23:32 history
-rw-r--r-- 1 techtonik techtonik 0 ліс 7 14:03 tagged
How to fix that?
UPD: $EDITOR
is empty, rifle
still runs the ed
.
$ rifle -l ~/.config/neofetch/config.conf
0:editor::$EDITOR -- "$@"
1:pager::"$PAGER" -- "$@"
$ echo $EDITOR
$ rifle ~/.config/neofetch/config.conf
13949
UPD2: Ubuntu 18.10
UPD3: I don't see that ed
is selected by OS
$ update-alternatives --display editor
editor - auto mode
link best version is /bin/nano
link currently points to /bin/nano
link editor is /usr/bin/editor
slave editor.1.gz is /usr/share/man/man1/editor.1.gz
slave editor.fr.1.gz is /usr/share/man/fr/man1/editor.1.gz
slave editor.it.1.gz is /usr/share/man/it/man1/editor.1.gz
slave editor.ja.1.gz is /usr/share/man/ja/man1/editor.1.gz
slave editor.pl.1.gz is /usr/share/man/pl/man1/editor.1.gz
slave editor.ru.1.gz is /usr/share/man/ru/man1/editor.1.gz
/bin/ed - priority -100
slave editor.1.gz: /usr/share/man/man1/ed.1.gz
/bin/nano - priority 40
slave editor.1.gz: /usr/share/man/man1/nano.1.gz
/usr/bin/vim.basic - priority 30
slave editor.1.gz: /usr/share/man/man1/vim.1.gz
slave editor.fr.1.gz: /usr/share/man/fr/man1/vim.1.gz
slave editor.it.1.gz: /usr/share/man/it/man1/vim.1.gz
slave editor.ja.1.gz: /usr/share/man/ja/man1/vim.1.gz
slave editor.pl.1.gz: /usr/share/man/pl/man1/vim.1.gz
slave editor.ru.1.gz: /usr/share/man/ru/man1/vim.1.gz
/usr/bin/vim.tiny - priority 15
slave editor.1.gz: /usr/share/man/man1/vim.1.gz
slave editor.fr.1.gz: /usr/share/man/fr/man1/vim.1.gz
slave editor.it.1.gz: /usr/share/man/it/man1/vim.1.gz
slave editor.ja.1.gz: /usr/share/man/ja/man1/vim.1.gz
slave editor.pl.1.gz: /usr/share/man/pl/man1/vim.1.gz
slave editor.ru.1.gz: /usr/share/man/ru/man1/vim.1.gz
ubuntu alternatives ranger ed
1
Ed, man! !man ed
– dessert
Nov 24 at 21:23
1
Did you try running it as e.g.EDITOR=vim ranger
?
– dessert
Nov 24 at 21:29
Oh, I am sure it will invokevim
as expected. However, I want to know whereranger
stores theed
setting.
– anatoly techtonik
Nov 24 at 21:31
It is an enviromental VAR set in the OS/SHELL/WHATEVER other than in ranger itself. global
– Michael Prokopec
Nov 24 at 21:33
@dessert You know your stuff too.
– Michael Prokopec
Nov 24 at 21:39
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
On a fresh ranger
install I tried to open neofetch
config with ranger
and selected ed
to see what is it. I am glad Ctrl+D worked to exit the ed
, but now ranger
opens all files with it. Restarting terminal didn't work. ~/.config/ranger
is empty:
$ ls -la .config/ranger/
total 12
drwxr-xr-x 2 techtonik techtonik 4096 ліс 24 23:32 .
drwx------ 24 techtonik techtonik 4096 ліс 24 22:19 ..
-rw-r--r-- 1 techtonik techtonik 35 ліс 24 23:32 bookmarks
-rw-r--r-- 1 techtonik techtonik 0 ліс 24 23:32 history
-rw-r--r-- 1 techtonik techtonik 0 ліс 7 14:03 tagged
How to fix that?
UPD: $EDITOR
is empty, rifle
still runs the ed
.
$ rifle -l ~/.config/neofetch/config.conf
0:editor::$EDITOR -- "$@"
1:pager::"$PAGER" -- "$@"
$ echo $EDITOR
$ rifle ~/.config/neofetch/config.conf
13949
UPD2: Ubuntu 18.10
UPD3: I don't see that ed
is selected by OS
$ update-alternatives --display editor
editor - auto mode
link best version is /bin/nano
link currently points to /bin/nano
link editor is /usr/bin/editor
slave editor.1.gz is /usr/share/man/man1/editor.1.gz
slave editor.fr.1.gz is /usr/share/man/fr/man1/editor.1.gz
slave editor.it.1.gz is /usr/share/man/it/man1/editor.1.gz
slave editor.ja.1.gz is /usr/share/man/ja/man1/editor.1.gz
slave editor.pl.1.gz is /usr/share/man/pl/man1/editor.1.gz
slave editor.ru.1.gz is /usr/share/man/ru/man1/editor.1.gz
/bin/ed - priority -100
slave editor.1.gz: /usr/share/man/man1/ed.1.gz
/bin/nano - priority 40
slave editor.1.gz: /usr/share/man/man1/nano.1.gz
/usr/bin/vim.basic - priority 30
slave editor.1.gz: /usr/share/man/man1/vim.1.gz
slave editor.fr.1.gz: /usr/share/man/fr/man1/vim.1.gz
slave editor.it.1.gz: /usr/share/man/it/man1/vim.1.gz
slave editor.ja.1.gz: /usr/share/man/ja/man1/vim.1.gz
slave editor.pl.1.gz: /usr/share/man/pl/man1/vim.1.gz
slave editor.ru.1.gz: /usr/share/man/ru/man1/vim.1.gz
/usr/bin/vim.tiny - priority 15
slave editor.1.gz: /usr/share/man/man1/vim.1.gz
slave editor.fr.1.gz: /usr/share/man/fr/man1/vim.1.gz
slave editor.it.1.gz: /usr/share/man/it/man1/vim.1.gz
slave editor.ja.1.gz: /usr/share/man/ja/man1/vim.1.gz
slave editor.pl.1.gz: /usr/share/man/pl/man1/vim.1.gz
slave editor.ru.1.gz: /usr/share/man/ru/man1/vim.1.gz
ubuntu alternatives ranger ed
On a fresh ranger
install I tried to open neofetch
config with ranger
and selected ed
to see what is it. I am glad Ctrl+D worked to exit the ed
, but now ranger
opens all files with it. Restarting terminal didn't work. ~/.config/ranger
is empty:
$ ls -la .config/ranger/
total 12
drwxr-xr-x 2 techtonik techtonik 4096 ліс 24 23:32 .
drwx------ 24 techtonik techtonik 4096 ліс 24 22:19 ..
-rw-r--r-- 1 techtonik techtonik 35 ліс 24 23:32 bookmarks
-rw-r--r-- 1 techtonik techtonik 0 ліс 24 23:32 history
-rw-r--r-- 1 techtonik techtonik 0 ліс 7 14:03 tagged
How to fix that?
UPD: $EDITOR
is empty, rifle
still runs the ed
.
$ rifle -l ~/.config/neofetch/config.conf
0:editor::$EDITOR -- "$@"
1:pager::"$PAGER" -- "$@"
$ echo $EDITOR
$ rifle ~/.config/neofetch/config.conf
13949
UPD2: Ubuntu 18.10
UPD3: I don't see that ed
is selected by OS
$ update-alternatives --display editor
editor - auto mode
link best version is /bin/nano
link currently points to /bin/nano
link editor is /usr/bin/editor
slave editor.1.gz is /usr/share/man/man1/editor.1.gz
slave editor.fr.1.gz is /usr/share/man/fr/man1/editor.1.gz
slave editor.it.1.gz is /usr/share/man/it/man1/editor.1.gz
slave editor.ja.1.gz is /usr/share/man/ja/man1/editor.1.gz
slave editor.pl.1.gz is /usr/share/man/pl/man1/editor.1.gz
slave editor.ru.1.gz is /usr/share/man/ru/man1/editor.1.gz
/bin/ed - priority -100
slave editor.1.gz: /usr/share/man/man1/ed.1.gz
/bin/nano - priority 40
slave editor.1.gz: /usr/share/man/man1/nano.1.gz
/usr/bin/vim.basic - priority 30
slave editor.1.gz: /usr/share/man/man1/vim.1.gz
slave editor.fr.1.gz: /usr/share/man/fr/man1/vim.1.gz
slave editor.it.1.gz: /usr/share/man/it/man1/vim.1.gz
slave editor.ja.1.gz: /usr/share/man/ja/man1/vim.1.gz
slave editor.pl.1.gz: /usr/share/man/pl/man1/vim.1.gz
slave editor.ru.1.gz: /usr/share/man/ru/man1/vim.1.gz
/usr/bin/vim.tiny - priority 15
slave editor.1.gz: /usr/share/man/man1/vim.1.gz
slave editor.fr.1.gz: /usr/share/man/fr/man1/vim.1.gz
slave editor.it.1.gz: /usr/share/man/it/man1/vim.1.gz
slave editor.ja.1.gz: /usr/share/man/ja/man1/vim.1.gz
slave editor.pl.1.gz: /usr/share/man/pl/man1/vim.1.gz
slave editor.ru.1.gz: /usr/share/man/ru/man1/vim.1.gz
ubuntu alternatives ranger ed
ubuntu alternatives ranger ed
edited Nov 26 at 1:06
Rui F Ribeiro
38.3k1476127
38.3k1476127
asked Nov 24 at 20:44
anatoly techtonik
867825
867825
1
Ed, man! !man ed
– dessert
Nov 24 at 21:23
1
Did you try running it as e.g.EDITOR=vim ranger
?
– dessert
Nov 24 at 21:29
Oh, I am sure it will invokevim
as expected. However, I want to know whereranger
stores theed
setting.
– anatoly techtonik
Nov 24 at 21:31
It is an enviromental VAR set in the OS/SHELL/WHATEVER other than in ranger itself. global
– Michael Prokopec
Nov 24 at 21:33
@dessert You know your stuff too.
– Michael Prokopec
Nov 24 at 21:39
add a comment |
1
Ed, man! !man ed
– dessert
Nov 24 at 21:23
1
Did you try running it as e.g.EDITOR=vim ranger
?
– dessert
Nov 24 at 21:29
Oh, I am sure it will invokevim
as expected. However, I want to know whereranger
stores theed
setting.
– anatoly techtonik
Nov 24 at 21:31
It is an enviromental VAR set in the OS/SHELL/WHATEVER other than in ranger itself. global
– Michael Prokopec
Nov 24 at 21:33
@dessert You know your stuff too.
– Michael Prokopec
Nov 24 at 21:39
1
1
Ed, man! !man ed
– dessert
Nov 24 at 21:23
Ed, man! !man ed
– dessert
Nov 24 at 21:23
1
1
Did you try running it as e.g.
EDITOR=vim ranger
?– dessert
Nov 24 at 21:29
Did you try running it as e.g.
EDITOR=vim ranger
?– dessert
Nov 24 at 21:29
Oh, I am sure it will invoke
vim
as expected. However, I want to know where ranger
stores the ed
setting.– anatoly techtonik
Nov 24 at 21:31
Oh, I am sure it will invoke
vim
as expected. However, I want to know where ranger
stores the ed
setting.– anatoly techtonik
Nov 24 at 21:31
It is an enviromental VAR set in the OS/SHELL/WHATEVER other than in ranger itself. global
– Michael Prokopec
Nov 24 at 21:33
It is an enviromental VAR set in the OS/SHELL/WHATEVER other than in ranger itself. global
– Michael Prokopec
Nov 24 at 21:33
@dessert You know your stuff too.
– Michael Prokopec
Nov 24 at 21:39
@dessert You know your stuff too.
– Michael Prokopec
Nov 24 at 21:39
add a comment |
2 Answers
2
active
oldest
votes
up vote
0
down vote
Check what editor, the os itself is pointing at. I think, ranger is looking at the now default for the os. Change the os's perfered editor, and I think it will change rangers.
sudo update-alternatives --config editor
Type the number of the one you want and hit enter.
In your case
auto mode
/bin/ed - priority -100
Each alternative has a priority associated with it. When a link group is in automatic mode, the alternatives pointed to by members of the group will be those which have the highest priority.
Set priority to 10
Change that and you should be good.
I updated the question that I am using Ubuntu 18.10. I have no idea how to check what editor Ubuntu is pointing at.
– anatoly techtonik
Nov 24 at 21:01
Updated the question to show thated
is probably not selected as default OS editor byupdate-alternatives
.
– anatoly techtonik
Nov 24 at 21:11
/bin/ed - priority -100
– Michael Prokopec
Nov 24 at 21:16
-100
means it should be selected last, afternano
(40) andvim
(30). If I runeditor ~/.config/neofetch/config.conf
thenano
is opened.
– anatoly techtonik
Nov 24 at 21:18
Ok, humor me and change it to 10. Tell me what happens.
– Michael Prokopec
Nov 24 at 21:23
|
show 2 more comments
up vote
0
down vote
accepted
As pointed out by @toon in ranger
tracker, ranger
doesn't provide any editor selection dialogs if EDITOR is not set. It resorts to hardcoded vim
, but Debian/Ubuntu hackers patch ranger to use sensible-editor
, which is a bash script that is not connected with updates-alternatives
in any way, and stores editor choice in ~/.selected_editor
:
$ cat ~/.selected_editor
# Generated by /usr/bin/select-editor
SELECTED_EDITOR="/bin/ed"
I guess this sensible-editor
bash script was implemented as a hack, because update-alternatives
works on a system level, and users without root needed to edit bash config to select their EDITOR (which doesn't work for everyone).
Instead of implicitly patching ranger
, the Debian folks could explicitly set EDITOR=sensible-editor
for user level sessions. "Explicit is better than implicit". At least this way we won't spend so much time here. Digging man
I found that sensible-editor
is explained in this policy page:
If it is very hard to adapt a program to make use of the EDITOR or PAGER variables, that program may be configured to use /usr/bin/sensible-editor and /usr/bin/sensible-pager as the editor or pager program respectively.
And according to this text, ranger
should not be patched, because it is already aware and makes use of EDITOR.
Closing this with final rants, why the ed
is given as the user-level choice of Linux editor in 2018 ???..
add a comment |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
Check what editor, the os itself is pointing at. I think, ranger is looking at the now default for the os. Change the os's perfered editor, and I think it will change rangers.
sudo update-alternatives --config editor
Type the number of the one you want and hit enter.
In your case
auto mode
/bin/ed - priority -100
Each alternative has a priority associated with it. When a link group is in automatic mode, the alternatives pointed to by members of the group will be those which have the highest priority.
Set priority to 10
Change that and you should be good.
I updated the question that I am using Ubuntu 18.10. I have no idea how to check what editor Ubuntu is pointing at.
– anatoly techtonik
Nov 24 at 21:01
Updated the question to show thated
is probably not selected as default OS editor byupdate-alternatives
.
– anatoly techtonik
Nov 24 at 21:11
/bin/ed - priority -100
– Michael Prokopec
Nov 24 at 21:16
-100
means it should be selected last, afternano
(40) andvim
(30). If I runeditor ~/.config/neofetch/config.conf
thenano
is opened.
– anatoly techtonik
Nov 24 at 21:18
Ok, humor me and change it to 10. Tell me what happens.
– Michael Prokopec
Nov 24 at 21:23
|
show 2 more comments
up vote
0
down vote
Check what editor, the os itself is pointing at. I think, ranger is looking at the now default for the os. Change the os's perfered editor, and I think it will change rangers.
sudo update-alternatives --config editor
Type the number of the one you want and hit enter.
In your case
auto mode
/bin/ed - priority -100
Each alternative has a priority associated with it. When a link group is in automatic mode, the alternatives pointed to by members of the group will be those which have the highest priority.
Set priority to 10
Change that and you should be good.
I updated the question that I am using Ubuntu 18.10. I have no idea how to check what editor Ubuntu is pointing at.
– anatoly techtonik
Nov 24 at 21:01
Updated the question to show thated
is probably not selected as default OS editor byupdate-alternatives
.
– anatoly techtonik
Nov 24 at 21:11
/bin/ed - priority -100
– Michael Prokopec
Nov 24 at 21:16
-100
means it should be selected last, afternano
(40) andvim
(30). If I runeditor ~/.config/neofetch/config.conf
thenano
is opened.
– anatoly techtonik
Nov 24 at 21:18
Ok, humor me and change it to 10. Tell me what happens.
– Michael Prokopec
Nov 24 at 21:23
|
show 2 more comments
up vote
0
down vote
up vote
0
down vote
Check what editor, the os itself is pointing at. I think, ranger is looking at the now default for the os. Change the os's perfered editor, and I think it will change rangers.
sudo update-alternatives --config editor
Type the number of the one you want and hit enter.
In your case
auto mode
/bin/ed - priority -100
Each alternative has a priority associated with it. When a link group is in automatic mode, the alternatives pointed to by members of the group will be those which have the highest priority.
Set priority to 10
Change that and you should be good.
Check what editor, the os itself is pointing at. I think, ranger is looking at the now default for the os. Change the os's perfered editor, and I think it will change rangers.
sudo update-alternatives --config editor
Type the number of the one you want and hit enter.
In your case
auto mode
/bin/ed - priority -100
Each alternative has a priority associated with it. When a link group is in automatic mode, the alternatives pointed to by members of the group will be those which have the highest priority.
Set priority to 10
Change that and you should be good.
edited Nov 24 at 21:31
answered Nov 24 at 20:57
Michael Prokopec
68916
68916
I updated the question that I am using Ubuntu 18.10. I have no idea how to check what editor Ubuntu is pointing at.
– anatoly techtonik
Nov 24 at 21:01
Updated the question to show thated
is probably not selected as default OS editor byupdate-alternatives
.
– anatoly techtonik
Nov 24 at 21:11
/bin/ed - priority -100
– Michael Prokopec
Nov 24 at 21:16
-100
means it should be selected last, afternano
(40) andvim
(30). If I runeditor ~/.config/neofetch/config.conf
thenano
is opened.
– anatoly techtonik
Nov 24 at 21:18
Ok, humor me and change it to 10. Tell me what happens.
– Michael Prokopec
Nov 24 at 21:23
|
show 2 more comments
I updated the question that I am using Ubuntu 18.10. I have no idea how to check what editor Ubuntu is pointing at.
– anatoly techtonik
Nov 24 at 21:01
Updated the question to show thated
is probably not selected as default OS editor byupdate-alternatives
.
– anatoly techtonik
Nov 24 at 21:11
/bin/ed - priority -100
– Michael Prokopec
Nov 24 at 21:16
-100
means it should be selected last, afternano
(40) andvim
(30). If I runeditor ~/.config/neofetch/config.conf
thenano
is opened.
– anatoly techtonik
Nov 24 at 21:18
Ok, humor me and change it to 10. Tell me what happens.
– Michael Prokopec
Nov 24 at 21:23
I updated the question that I am using Ubuntu 18.10. I have no idea how to check what editor Ubuntu is pointing at.
– anatoly techtonik
Nov 24 at 21:01
I updated the question that I am using Ubuntu 18.10. I have no idea how to check what editor Ubuntu is pointing at.
– anatoly techtonik
Nov 24 at 21:01
Updated the question to show that
ed
is probably not selected as default OS editor by update-alternatives
.– anatoly techtonik
Nov 24 at 21:11
Updated the question to show that
ed
is probably not selected as default OS editor by update-alternatives
.– anatoly techtonik
Nov 24 at 21:11
/bin/ed - priority -100
– Michael Prokopec
Nov 24 at 21:16
/bin/ed - priority -100
– Michael Prokopec
Nov 24 at 21:16
-100
means it should be selected last, after nano
(40) and vim
(30). If I run editor ~/.config/neofetch/config.conf
the nano
is opened.– anatoly techtonik
Nov 24 at 21:18
-100
means it should be selected last, after nano
(40) and vim
(30). If I run editor ~/.config/neofetch/config.conf
the nano
is opened.– anatoly techtonik
Nov 24 at 21:18
Ok, humor me and change it to 10. Tell me what happens.
– Michael Prokopec
Nov 24 at 21:23
Ok, humor me and change it to 10. Tell me what happens.
– Michael Prokopec
Nov 24 at 21:23
|
show 2 more comments
up vote
0
down vote
accepted
As pointed out by @toon in ranger
tracker, ranger
doesn't provide any editor selection dialogs if EDITOR is not set. It resorts to hardcoded vim
, but Debian/Ubuntu hackers patch ranger to use sensible-editor
, which is a bash script that is not connected with updates-alternatives
in any way, and stores editor choice in ~/.selected_editor
:
$ cat ~/.selected_editor
# Generated by /usr/bin/select-editor
SELECTED_EDITOR="/bin/ed"
I guess this sensible-editor
bash script was implemented as a hack, because update-alternatives
works on a system level, and users without root needed to edit bash config to select their EDITOR (which doesn't work for everyone).
Instead of implicitly patching ranger
, the Debian folks could explicitly set EDITOR=sensible-editor
for user level sessions. "Explicit is better than implicit". At least this way we won't spend so much time here. Digging man
I found that sensible-editor
is explained in this policy page:
If it is very hard to adapt a program to make use of the EDITOR or PAGER variables, that program may be configured to use /usr/bin/sensible-editor and /usr/bin/sensible-pager as the editor or pager program respectively.
And according to this text, ranger
should not be patched, because it is already aware and makes use of EDITOR.
Closing this with final rants, why the ed
is given as the user-level choice of Linux editor in 2018 ???..
add a comment |
up vote
0
down vote
accepted
As pointed out by @toon in ranger
tracker, ranger
doesn't provide any editor selection dialogs if EDITOR is not set. It resorts to hardcoded vim
, but Debian/Ubuntu hackers patch ranger to use sensible-editor
, which is a bash script that is not connected with updates-alternatives
in any way, and stores editor choice in ~/.selected_editor
:
$ cat ~/.selected_editor
# Generated by /usr/bin/select-editor
SELECTED_EDITOR="/bin/ed"
I guess this sensible-editor
bash script was implemented as a hack, because update-alternatives
works on a system level, and users without root needed to edit bash config to select their EDITOR (which doesn't work for everyone).
Instead of implicitly patching ranger
, the Debian folks could explicitly set EDITOR=sensible-editor
for user level sessions. "Explicit is better than implicit". At least this way we won't spend so much time here. Digging man
I found that sensible-editor
is explained in this policy page:
If it is very hard to adapt a program to make use of the EDITOR or PAGER variables, that program may be configured to use /usr/bin/sensible-editor and /usr/bin/sensible-pager as the editor or pager program respectively.
And according to this text, ranger
should not be patched, because it is already aware and makes use of EDITOR.
Closing this with final rants, why the ed
is given as the user-level choice of Linux editor in 2018 ???..
add a comment |
up vote
0
down vote
accepted
up vote
0
down vote
accepted
As pointed out by @toon in ranger
tracker, ranger
doesn't provide any editor selection dialogs if EDITOR is not set. It resorts to hardcoded vim
, but Debian/Ubuntu hackers patch ranger to use sensible-editor
, which is a bash script that is not connected with updates-alternatives
in any way, and stores editor choice in ~/.selected_editor
:
$ cat ~/.selected_editor
# Generated by /usr/bin/select-editor
SELECTED_EDITOR="/bin/ed"
I guess this sensible-editor
bash script was implemented as a hack, because update-alternatives
works on a system level, and users without root needed to edit bash config to select their EDITOR (which doesn't work for everyone).
Instead of implicitly patching ranger
, the Debian folks could explicitly set EDITOR=sensible-editor
for user level sessions. "Explicit is better than implicit". At least this way we won't spend so much time here. Digging man
I found that sensible-editor
is explained in this policy page:
If it is very hard to adapt a program to make use of the EDITOR or PAGER variables, that program may be configured to use /usr/bin/sensible-editor and /usr/bin/sensible-pager as the editor or pager program respectively.
And according to this text, ranger
should not be patched, because it is already aware and makes use of EDITOR.
Closing this with final rants, why the ed
is given as the user-level choice of Linux editor in 2018 ???..
As pointed out by @toon in ranger
tracker, ranger
doesn't provide any editor selection dialogs if EDITOR is not set. It resorts to hardcoded vim
, but Debian/Ubuntu hackers patch ranger to use sensible-editor
, which is a bash script that is not connected with updates-alternatives
in any way, and stores editor choice in ~/.selected_editor
:
$ cat ~/.selected_editor
# Generated by /usr/bin/select-editor
SELECTED_EDITOR="/bin/ed"
I guess this sensible-editor
bash script was implemented as a hack, because update-alternatives
works on a system level, and users without root needed to edit bash config to select their EDITOR (which doesn't work for everyone).
Instead of implicitly patching ranger
, the Debian folks could explicitly set EDITOR=sensible-editor
for user level sessions. "Explicit is better than implicit". At least this way we won't spend so much time here. Digging man
I found that sensible-editor
is explained in this policy page:
If it is very hard to adapt a program to make use of the EDITOR or PAGER variables, that program may be configured to use /usr/bin/sensible-editor and /usr/bin/sensible-pager as the editor or pager program respectively.
And according to this text, ranger
should not be patched, because it is already aware and makes use of EDITOR.
Closing this with final rants, why the ed
is given as the user-level choice of Linux editor in 2018 ???..
answered Nov 26 at 6:51
anatoly techtonik
867825
867825
add a comment |
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f483921%2fwhere-is-the-editor-choice-kept-in-ranger%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Ed, man! !man ed
– dessert
Nov 24 at 21:23
1
Did you try running it as e.g.
EDITOR=vim ranger
?– dessert
Nov 24 at 21:29
Oh, I am sure it will invoke
vim
as expected. However, I want to know whereranger
stores theed
setting.– anatoly techtonik
Nov 24 at 21:31
It is an enviromental VAR set in the OS/SHELL/WHATEVER other than in ranger itself. global
– Michael Prokopec
Nov 24 at 21:33
@dessert You know your stuff too.
– Michael Prokopec
Nov 24 at 21:39