Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Other Things Gentoo
  • Search

using NeoVIM as $EDITOR

Still need help with Gentoo, and your question doesn't fit in the above forums? Here is your last bastion of hope.
Post Reply
Advanced search
12 posts • Page 1 of 1
Author
Message
b11n
Guru
Guru
User avatar
Posts: 303
Joined: Wed Mar 26, 2003 8:15 am
Location: New Zealand

using NeoVIM as $EDITOR

  • Quote

Post by b11n » Tue Jan 28, 2025 8:27 pm

I've already chosen nvim with `eselect vi`, but I've noticed apps that use $EDITOR are still launching vim. When I went to `eselect editor`, I saw that `vim` is explicitly specified.

I know that I can explicitly enter the path to `nvim` here (and have done so), but I just wanted to ask: shouldn't `eselect editor` use the vi symbolic link, or nvim be shown as one of the choices instead?

When searching, I found this very old post that shows that `eselect editor` at least used to have `vi` instead of explicitly `vim`
Last edited by b11n on Tue Jan 28, 2025 11:47 pm, edited 1 time in total.
Is there gas in the caaaaar?
Yes, there's gas in the caaaar
Top
grknight
Retired Dev
Retired Dev
Posts: 2560
Joined: Fri Feb 20, 2015 9:36 pm

  • Quote

Post by grknight » Tue Jan 28, 2025 8:35 pm

eselect editor has a very short hard coded list in /usr/share/eselect/modules/editor.eselect
Specifically

Code: Select all

EDITOR_LIST="nano emacs vim"
One could argue managing that list ad nauseam in bugs until the end of time or just free form your favorite editor instead.
Top
b11n
Guru
Guru
User avatar
Posts: 303
Joined: Wed Mar 26, 2003 8:15 am
Location: New Zealand

  • Quote

Post by b11n » Tue Jan 28, 2025 8:55 pm

grknight wrote:One could argue managing that list ad nauseam in bugs until the end of time or just free form your favorite editor instead.
Not what I want to do at all. Just seems that if `eselect vi` is intended as to manage which vi clone to use, then `eselect editor` should use that too rather than only have vim explicitly.

Found these bugs: 911792 930037. It looks like 911792 was asking why `vi` is not in the list, and it got 'fixed' by changing it to `vim`. Then 930037 is asking the same thing as I am, but got WONTFIX'ed.

IMO, 911792 was badly fixed, and now defeats the `eselect vi` setting.
Is there gas in the caaaaar?
Yes, there's gas in the caaaar
Top
Anon-E-moose
Watchman
Watchman
User avatar
Posts: 6566
Joined: Fri May 23, 2008 7:31 pm
Location: Dallas area

  • Quote

Post by Anon-E-moose » Tue Jan 28, 2025 11:07 pm

Code: Select all

$ grep EDITOR .bash_profile
export EDITOR=vi
from /etc/profile

Code: Select all

# You should override these in your ~/.bashrc (or equivalent) for per-user
# settings.  For system defaults, you can add a new file in /etc/profile.d/.
export EDITOR=${EDITOR:-/bin/nano}
export PAGER=${PAGER:-/usr/bin/less}
UM780 xtx, 6.18 zen kernel, gcc 15, openrc, wayland
minixforum m1-s1 max -- same software as above but used for ai learning


Zealots are gonna be zealots, just like haters are gonna be haters
Top
b11n
Guru
Guru
User avatar
Posts: 303
Joined: Wed Mar 26, 2003 8:15 am
Location: New Zealand

  • Quote

Post by b11n » Tue Jan 28, 2025 11:48 pm

I'm not trying to set an environment variable, thanks

I'm trying to start a discussion about counter-intuitive and surprising behaviour in eselect.
Is there gas in the caaaaar?
Yes, there's gas in the caaaar
Top
Anon-E-moose
Watchman
Watchman
User avatar
Posts: 6566
Joined: Fri May 23, 2008 7:31 pm
Location: Dallas area

  • Quote

Post by Anon-E-moose » Wed Jan 29, 2025 12:32 am

What's counter intuitive?

from eselect 4.17

Code: Select all

# list of most common cases only
EDITOR_LIST="nano ed emacs ex vi xemacs"
from 4.27

Code: Select all

# list of most common cases only
EDITOR_LIST="nano emacs vim"
If you select what is deemed not a common case, you can always set it to whatever you want.

Would you expect them to list ever editor available?
UM780 xtx, 6.18 zen kernel, gcc 15, openrc, wayland
minixforum m1-s1 max -- same software as above but used for ai learning


Zealots are gonna be zealots, just like haters are gonna be haters
Top
b11n
Guru
Guru
User avatar
Posts: 303
Joined: Wed Mar 26, 2003 8:15 am
Location: New Zealand

  • Quote

Post by b11n » Wed Jan 29, 2025 1:06 am

Anon-E-moose wrote:What's counter intuitive?
from eselect 4.17
…
from 4.27
Notice the change from vi to vim across those versions? Where we previously had vi (which in turn points to whatever `eselect vi` is set to) and now we have vim, which… doesn't. That's counterintuitive.

Also, if vim is not installed, (but some other clone is, and set up properly with eselect), there's no vi(*) option shown at all. That's less intuitive than an agnostic `vi` option which could show as long as /usr/bin/vi exists.
Anon-E-moose wrote:Would you expect them to list ever editor available?
No, I expect eselect to be consistent with… eselect.
Is there gas in the caaaaar?
Yes, there's gas in the caaaar
Top
ingenarel
n00b
n00b
User avatar
Posts: 15
Joined: Thu Jan 16, 2025 11:07 pm

  • Quote

Post by ingenarel » Wed Jan 29, 2025 8:24 am

might be a stupid fix, but i just have this in my zsh config:

Code: Select all

export EDITOR="/usr/bin/nvim"
Top
sMueggli
l33t
l33t
Posts: 627
Joined: Sat Sep 03, 2022 9:22 am

  • Quote

Post by sMueggli » Wed Jan 29, 2025 9:03 am

I think bent is expecting that if "eselect editor set vim" is used, that the $EDITOR environment variable is set to whatever symlink "eselect vi show" is pointing.

If "eselect vi" points to vim, setting "eselect editor set vim" is changing $EDITOR to vim.
If "eselect vi" points to nvim, setting "eselect editor set vim" is changing $EDITOR to nvim.
Top
Anon-E-moose
Watchman
Watchman
User avatar
Posts: 6566
Joined: Fri May 23, 2008 7:31 pm
Location: Dallas area

  • Quote

Post by Anon-E-moose » Wed Jan 29, 2025 10:28 am

sMueggli wrote:I think bent is expecting that if "eselect editor set vim" is used, that the $EDITOR environment variable is set to whatever symlink "eselect vi show" is pointing.
Then I would say that his expectations were/are wrong.
The EDITOR variable has been around for a long time, far longer than gentoo or even linux,
and it's always been common practice to set it yourself in your .profile or equivalent.
UM780 xtx, 6.18 zen kernel, gcc 15, openrc, wayland
minixforum m1-s1 max -- same software as above but used for ai learning


Zealots are gonna be zealots, just like haters are gonna be haters
Top
b11n
Guru
Guru
User avatar
Posts: 303
Joined: Wed Mar 26, 2003 8:15 am
Location: New Zealand

  • Quote

Post by b11n » Wed Jan 29, 2025 8:18 pm

sMueggli wrote:I think bent is expecting that if "eselect editor set vim" is used, that the $EDITOR environment variable is set to whatever symlink "eselect vi show" is pointing.
Nope. I am just proposing that `eselect editor list` show `vi` (not vim, not nvim, etc.), if any vi clone is installed. Otherwise, what's the point of `eselect vi set` existing, only for `eselect editor list` to simply ignore it and only work with one specific clone?

As it is now, `eselect editor list` only shows one vi clone: vim. Users of other clones will probably only see nano in the list. I know they can set it free-form, but they might not. They might wonder if there's some reason vi is not in the list. There is a reason, and it's a bad one: `eselect editor list` is hardcoded around vim, since https://bugs.gentoo.org/911792
Is there gas in the caaaaar?
Yes, there's gas in the caaaar
Top
b11n
Guru
Guru
User avatar
Posts: 303
Joined: Wed Mar 26, 2003 8:15 am
Location: New Zealand

  • Quote

Post by b11n » Wed Jan 29, 2025 11:19 pm

Here's the documentation that incorrectly tells users that installing (some vi clone other than vim) and symlinking vi to it will cause it to show in `eselect editor list`

Here's the (reopened) bug, if you want to see how this terrible saga plays out, and yes, I will die on this hill.
Is there gas in the caaaaar?
Yes, there's gas in the caaaar
Top
Post Reply

12 posts • Page 1 of 1

Return to “Other Things Gentoo”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic