FS#62762 - [neovim] Propose moving /usr/share/nvim/sysinit.vim to /etc/xdg/nvim/sysinit.vim
Attached to Project:
Community Packages
Opened by James Harvey (jamespharvey20) - Tuesday, 28 May 2019, 10:04 GMT
Last edited by Sven-Hendrik Haase (Svenstaro) - Sunday, 23 June 2019, 06:37 GMT
Opened by James Harvey (jamespharvey20) - Tuesday, 28 May 2019, 10:04 GMT
Last edited by Sven-Hendrik Haase (Svenstaro) - Sunday, 23 June 2019, 06:37 GMT
|
Details
Neovim loads a global configuration file from
"$XDG_CONFIG_DIRS/nvim/sysinit.vim" if it exists (on Arch,
by default "/etc/xdg/nvim/sysinit.vim"), or if it doesn't
exist, from "/usr/share/nvim/sysinit.vim".
The latter of course should not be user edited. The Arch package provides the latter, it is not from upstream. See https://git.archlinux.org/svntogit/community.git/tree/trunk/PKGBUILD?h=packages/neovim#L44 Its only contents are to make pacman-installed vim packages work. The Arch package does not provide the former. This means if a user wishes to edit Neovim's global configuration file, they have to create a file in "/etc". But, by doing so, the "/usr/share" file is prevented from being loaded. If the user wants pacman-installed vim packages to work, they have to copy the contents of the "/usr/share" file into the new "/etc" one or source it. A user might not realize they need to do this. I think it would be better if the file were just moved from "/usr/share" to "/etc" and added to "backup()". The only counter-argument I thought of is the location in "/etc" is changed if the user changes "$XDG_CONFIG_DIRS". I could be wrong, but I doubt that happens often, and think someone doing that is going to encounter having to deal with a lot of such issues already. If a package starts including a new "/etc" file that a user has already created on their system, as long as it's in "backup()", there is not a conflicting file error on installation. It gracefully makes a ".pacnew". Some in IRC had the opinion that packages shouldn't install anything to "/etc" when they could install one to "/usr/share". Vim can support a global configuration file from there too, so I'm not sure why this should be different. In vim-common's case, its "/etc/vimrc" is just sourcing the "/usr/share/vim/archlinux.vim" file. That could have just been named "/usr/share/vim/vimrc" and "/etc/vimrc" could be avoided. |
This task depends upon
Comment by
James Harvey (jamespharvey20) -
Tuesday, 28 May 2019, 10:05 GMT
Comment by
Sven-Hendrik Haase (Svenstaro) -
Tuesday, 18 June 2019, 00:51 GMT
... or, if desired, instead of moving the file, a new "/etc" could
be made that sources the existing "/usr" file, like how vim-common
does it.
Great issue report. Check the new package in [community]. Does
that seem like it would fix this problem?