New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Neovim template should not contest Vim namespace in alternatives
#36164
Comments
That's just not true, if something installed provides an alternative already, xbps should not change it until you use $ xbps-alternatives -l
...
vi
- nvi (current)
...
$ xi vim
...
$ xbps-alternatives -l
...
vi
- nvi (current)
- vim-common
vim
- vim (current)
...
$ xi neovim
...
$ xbps-alternatives -l
...
vi
- nvi (current)
- vim-common
- neovim
vim
- vim (current)
- neovim
... Maybe you installed |
sounds like an issue with your terminal configuration, or something that should be reported upstream to neovim. I don't have this issue with |
and they can make that choice by installing either package. Neither one is included in void by default ( |
Maybe it was
Just my 2¢: having to run
Uninstalling Neovim is also an unacceptable solution for those who wish to use both |
I agree that this shouldn't have been handled with alternatives, but now we if we wanted to remove yhem, we have a problem. I am not saying this is a bad idea, but it's not without problems.
You can just use the xbps-alternatives command to switch to vim and just have both. If you installed them in the right order - vim, then neovim, you don't even have to touch alternatives. I see why this is confusing and this is part of the reason I don't think nvim should be a vim alternative. On the other hand, I have never seen too different behavior from nvim and vim ootb without any configuration. |
Equally bad (or worse): running It’s a predicament either way. If you’d allow me to hazard a guess, the group of Void users setting Perhaps the symlinks can be deprecated in an announcement, and removed at a pre-determined time in the future? |
how is that a footgun? how is getting neovim as root a bad thing? Remember, you have to set the alternative if you have both vim and neovim installed |
Can anyone commenting defend their preference for typing out |
If |
For me, it's shorter and I don't have to remember which machine I am on and whether it has nvim or vim.
That's wrong, I just used it as an example and I can imagine some people having this in their rc/.profile. |
But |
I have a machine that is also used by others, but I'm in charge and want neovim and therefore have no use to keep vim around. So far this has caused zero issues, actually it solved a couple with some terminal stuff, I don't quite remember. This is debian machine fwiw, so there are other distros that behave that way. |
List of OS vendors symlinking
List of OS vendors not symlinking
|
You made a list of linux distributions separating them by having an alternatives system. What is the problem with setting the alternatives to the state you want as opposed to demanding to remove that feature because you personally don't like it. |
Yesterday, I suggested doing: # Template file for 'dash'
alternatives="
sh:sh:/usr/bin/dash
sh:sh.1:/usr/share/man/man1/dash.1"
# Template file for 'bash'
alternatives="
sh:sh:/usr/bin/bash
sh:sh.1:/usr/share/man/man1/bash.1"
# Template file for 'neovim'
alternatives="
vi:vi:/usr/bin/nvim
vi:vi.1:/usr/share/man/man1/nvim.1 I’ve updated the PR accordingly, to minimize any confusion. I simply don’t recognize any level of logical consistency in the way Neovim is allowed to easily override |
I think the problem is that voids alternative system doesn't have priorities like debians alternative system has. This leads to confusion when vim is installed after neovim was installed and it doesn't automatically choose the one with highest priority (which would be vim). To solve this, we would need to implement priorities for our alternatives which is too much effort in my opinion. |
Shouldn't have closed it, but I don't think this would get my approval.
The alternatives switching just because you install something with a higher priority doesn't sound like a good idea.
External programs depending on dash being dash and bash being bash is IMHO different from a vim fork being allowed as alternative for vim. |
I’ve prepended I’d like to hear alternative opinions. Thank you for not closing @Duncaen. That was very considerate of you. I appreciate it. |
This priorities thing is what debian does at least... Except that I was wrong on this particular case: Debians vim and nvim have the same priorities so it doesn't switch automatically. But on another case like installing openjdk-17-jre after openjdk-11-jre it holds true that debian automatically switches the alternatives because openjdk-17-jre has a greater priority. |
I think this is wrong. 👍 for closing. |
Thanks for opining, @Vaelatern. I noticed your name is listed as the maintainer of Neomutt. According to Neomutt’s homepage:
This seems quite analagous to the relationship between Neovim and Vim. However, the Neomutt template doesn’t use Why is Bear in mind I’ve proposed continuing to allow |
is there not a bigger gulf between |
I agree with @Vaelatern and because there 3 team members agree on this, I am closing this issue. |
@atweiden you'll find that neomutt deliberately broke compat and suggested it no longer be the same. For neomutt, this was the answer. For neovim it's not. |
Try opening a file with
That’s because Neovim has broken Vim compatibility in several subtle ways for a long time now. Here’s another example: Vim uses viminfo files, but Neovim uses an incompatible ShaDa file. Hence, when attempting to share the same config between if !has('nvim')
set viminfofile=$VIMPATH/viminfo
if filereadable(&viminfofile)
rviminfo
endif
else
if filereadable($XDG_DATA_HOME . '/nvim/shada/main.shada')
rshada
endif
endif Otherwise you’ll get an error on startup.
Bram Moolenaar has been merging features and bug fixes to upstream Vim at a considerably faster pace than Neovim can integrate them downstream for the last several years consecutively. This isn’t meant to throw any shade on Neovim — it’s good to see so much third party development happening on Neovim in Lua. But they’re divergent software projects in several respects. There was a limited period of time c. 2016 when Neovim was still fighting to become “Vim” due to perceived inaction on Bram’s part. That didn’t happen, but people who don’t heavily use Vim or Neovim may not be aware of such things. |
It so happens that I do heavily use vim. And I recently set my alternative for vim to neovim (want to use a Lua-only plugin). The decision stands. |
Summary:
The
neovim
template should not install symlinks contesting thevim
namespace.Reasoning:
No other major OS vendor treats Neovim and Vim in this way.
In 2022, anyone choosing to open Neovim instead of Vim, or vice versa, is making a very deliberate choice. Because Neovim supports Lua as a first class citizen, while Vim only supports Vimscript as a first class citizen, Neovim’s plugin ecosystem has begun to differ significantly from Vim’s. The Neovim editor is increasingly configured separately from Vim — often in Lua, and with a different selection of plugins.
By default, an unconfigured Neovim severely alters the terminal cursor’s appearance in a manner which is difficult to counteract without ending the active terminal session. Accidentally opening an unconfigured Neovim instance upon typing
vim
into a terminal creates an awful user experience — which is precisely what happens when a user installs Neovim after Vim, due to theneovim
template’s use ofalternatives
.I’ve been using Vim and Neovim both for a good, long while. To any Neovim fans, I wouldn’t have opened this issue if I didn’t want both programs installed simultaneously. But If I’m typing
vim
in my terminal, I’m most definitely not expecting Neovim to pop open. Typevim
, and “the” Vim should open, or an error message should appear. At present, due to theneovim
template’s use ofalternatives
, when you typevim
,nvim
pops open instead, and the terminal cursor’s appearance is ruined until you exit the terminal session.The text was updated successfully, but these errors were encountered: