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
vimUtils.vimrcFile: fixes packpath order #78385
Conversation
cc @kalbasit since he was doing some vim work recently |
@jonringer @kalbasit Can this PR get reviewed ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, let me get some other's opinions
this seems to be a long standing issue, and it seems like you did your due diligence on investigating a solution. Thanks! |
|
Just tested this with a simple config :
and |
My main concern is that people have already developed hacks around the pre-existing design, and they might be incompatible with this fix. |
that being said, I would rather have "normal path" work fine, than people having to search through issues and PRs to get their vim workflow going. The individuals who have already developed hacks likely have context to what they did and why it might be wrong. |
@timokau might have some insights. Otherwise it looks good. |
I'll give this PR a try in my vim config and report back. |
@megheaiulian I can reproduce the issue with such minimal with import (builtins.fetchTarball https://github.com/NixOS/nixpkgs/archive/5d2ea07f02ba60aa7af2388381f14dd62a0978dc.tar.gz) {};
stdenv.mkDerivation {
name = "env";
buildInputs = [
(neovim.override {
configure = {
customRC = ''
set shiftwidth=2
set softtabstop=2
set expandtab
call coc#config('coc', {
\ 'preferences': {
\ 'codeLens.enable': "true",
\ 'colorSupport': "true",
\ 'extensionUpdateCheck': "never",
\ 'formatOnSaveFiletypes': [ "go" ],
\ },
\ 'suggest': {
\ 'acceptSuggestionOnCommitCharacter': "true",
\ 'enablePreview': "true",
\ 'timeout': 2000,
\ 'triggerAfterInsertEnter': "true",
\ },
\})
'';
packages.myVimPackage = with vimPlugins; {
start = [
coc-nvim
];
opt = [ ];
};
# Works fine with:
#plug.plugins = with vimPlugins; [
# coc-nvim
#];
};
})
];
} I'm getting this error with package system:
While with EDIT: Replaced |
It's been so long I forgot what was breaking on my end. |
@rvolosatovs After further investigating this I think your expectations are wrong. Please note the goal of this PR is not to have |
Thank you for investigating, my bad then - I assumed all plugins would be loaded already. https://github.com/neoclide/coc.nvim/wiki/Install-coc.nvim#using-vim8s-native-package-manager also does not mention anything about it 🤔 |
@rvolosatovs you could ask upstream about it and maybe fix their documentation than. |
I think we should backport this one also to at least 20.03, but let's wait for a bit until it hits the unstable channel. |
I wish this would be fixed upstream, seems like a bug to me. But at least we finally have a fix for nix, thanks @megheaiulian! |
plugin syntax files did not work with neovim installed with nix package manager . ## References - neovim/neovim#9390 - NixOS/nixpkgs#39364 (comment) - NixOS/nixpkgs#78385
Motivation for this change
Fix
vimUtils.vimrcFile
's packDir import order:rtp
after$VIMRUNTIME
. This breaks a lot of plugins as most of them expect the pack that the plugin is in to be loaded before$VIMRUNTIME
.set packpath^=...
is not enough and rtp must also be prepended with the packDir's path. This's makes vim/neovim load plugins from packs in packDir in order specified by its placement in rtp (weird behavior but that's how it works).vim
andneovim
will load thepackDir
in a similar manner as when placed in.vim/
or.config/neovim
and load order will be correct.Fixes #39364
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)