Skip to content
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

Declared neovim plugin seemingly not installed #815

Closed
tmplt opened this issue Aug 21, 2019 · 23 comments
Closed

Declared neovim plugin seemingly not installed #815

tmplt opened this issue Aug 21, 2019 · 23 comments

Comments

@tmplt
Copy link

tmplt commented Aug 21, 2019

In the processing of configuring everything with Nix I'm currently porting my neovim configuration. With the following:

{
  home-manager.users.tmplt.programs.neovim = {
    enable = true;
    configure = {
      packages.myVimPackage = with local.pkgs.vimPlugins; {
        start = [ vimtex ];
      };
    };
  };
}

I expect :h vimtex to open the plugin's help file, as is the case if the plugin is installed with vim-plugged, but the file cannot be found. Am I missing something in the declaration?

Cheers.

@tmplt tmplt changed the title Installed neovim plugin not Declared neovim plugin seemingly not installed Aug 21, 2019
@tmplt
Copy link
Author

tmplt commented Aug 21, 2019

I had to open a new terminal for changes to apply, apparently. Help file is now accesisble via :h vimtex, but commands like VimtexInfo that should exist when a .tex-file is opened are not defined.

@rycee
Copy link
Member

rycee commented Aug 29, 2019

@Gerschtli You seem to know about VIM. Do you have any idea what's going on here?

@Gerschtli
Copy link
Contributor

How did you executed neovim in your first try before opening a new terminal? Because the destination path to the nvim binary changes when you update neovim config.

I can reproduce that VimtexInfo is not defined, but I don't have any experience with vim plugins and vim script language.. nerdtree for example adds all commands successfully, maybe anyone can spot the difference.

@evanjs
Copy link
Contributor

evanjs commented Sep 10, 2019

Derp. Perhaps this is related to rust-vim getting really angry whenever I hit save.
Any information I can provide to help diagnose this issue?
Or at least determine if my case is related?

Though, I'm currently using the new neovim.plugins option

@Gerschtli
Copy link
Contributor

What do you mean with getting really angry?
I might have another look at it next week..
Does anyone know how to get some debug output of neovim trying to load the plugins?

@evanjs
Copy link
Contributor

evanjs commented Sep 13, 2019

I'll post the error messages once I'm at work. It spits out a bunch of them.

@evanjs
Copy link
Contributor

evanjs commented Sep 13, 2019

"src/main.rs" 50L, 1198C written                                                                                                                                                               
Error detected while processing function <SNR>45_BufWritePostHook[4]..<SNR>45_UpdateErrors[15]..<SNR>45_CacheErrors[39]..16[1]..15[24]..SyntaxCheckers_rust_cargo_GetLocList:                  
line   13:                                                                                                                                                                                     
E117: Unknown function: rust#GetConfigVar                                                                                                                                                      
E15: Invalid expression: rust#GetConfigVar('rust_cargo_avoid_whole_workspace', 1)                                                                                                              
Error detected while processing function <SNR>45_BufWritePostHook[4]..<SNR>45_UpdateErrors[15]..<SNR>45_CacheErrors:                                                                           
line   39:                                                                                                                                                                                     
E170: Missing :endfor                                                                                                                                                                          
Error detected while processing function <SNR>45_BufWritePostHook[4]..<SNR>45_UpdateErrors:                                                                                                    
line   15:                                                                                                                                                                                     
E171: Missing :endif 

Here's what I meant by rust-vim getting angry.
This happens after I save a Rust file.

@Gerschtli
Copy link
Contributor

On first sight it seems to me that not all vim config files get correctly sourced.. Did you get it working sometime before?
If you like you can look at the directory structure of the nerdtree package and rust-vim, maybe there is something obviously wrong packaged. Or try to search for similar issues in nixpkgs repo as we are simply passing the options through..

@evanjs
Copy link
Contributor

evanjs commented Sep 13, 2019

rust-vim seemed to work fine before, yes.
:scriptnames includes rust-vim, and the vim-pack-dir that the generated vimrc references contains all the rust-vim stuff, as well (shows up in vim-pack-dir/pack/home-manager/rust-vim, etc)
Nothing on nixpkgs issues, nor anything glaring in rust-vim.
It might also be the combination of plugins I'm using (syntastic, LanguageClient-neovim, etc)

I also wonder if this might be related to rust-vim with neovim in particular.

@Gerschtli
Copy link
Contributor

Interesting.. Maybe you can find the commit in home-manager and/or nixpkgs where rust-vim stopped working correctly in neovim. That would be my approach to find the error.

@evanjs
Copy link
Contributor

evanjs commented Sep 13, 2019

Ahhh @Gerschtli was on the right track. It was indeed a simple setting on my end.

I just had to set g:syntastic_rust_checkers to ['rustc'], as the default is now ['cargo'] if not specified.

Oddly enough, :h vimtex (what OP was trying) seems to work fine on my end.
Though, again, I'm not sure how my usage of neovim.plugins compares to OP's.

@Gerschtli
Copy link
Contributor

Ah perfect!

:h vimtex works for OP, see first comment. What is not working is that VimtexInfo command is not present. Does this work with your setup? If so, could you share your exact config?

@evanjs
Copy link
Contributor

evanjs commented Sep 14, 2019

Ah, that's correct, it does not.
Not quite sure what to look for in the log (via vim -V9vimlog sample.tex), either.
(p.s. nvim is symlinked to vim, hence the vim in the command)

@Gerschtli
Copy link
Contributor

Sorry for only giving instruction, but I don't get to my computer until next week and I don't have much time right now.. Thank you very much for your time and efforts! :)

Could you look, where the VimtexInfo is defined in the package and grep for vimtex in the output to find the line where this file got sourced. Maybe it doesn't get sourced or there is an error/warning.. Maybe compare to plugin like nerdtree where all commands are available.

@evanjs
Copy link
Contributor

evanjs commented Sep 22, 2019

Pretty sure it's just autoload/vimtex.vim, i.e. unless I'm misunderstanding autoload, it isn't being "sourced" directly, so to speak.
On a side note, it does look like the function is defined.
With :call <TAB><TAB> , I am able to run vimtex#init(), after which I can run various VimTex commands just fine.
Not exactly sure why the functions are not being run automatically, though, unless perhaps they are affected by any settings, etc, maybe?

@Gerschtli
Copy link
Contributor

The problem is the loading order (see for a similar issue lervag/vimtex#695). In position 23 (see log below) the builtin ftplugin for tex is loaded. vimtex has to be loaded before the builtin ones to work properly..

It seems to be an issue in the nixpkgs expression of neovim (and vim as well).. I have to investigate further.

My expression so far:

{
  programs.neovim.enable = true;
  programs.neovim.plugins = [ pkgs.vimPlugins.vimtex ];
}

Output of :scriptnames in neovim:

  1: /nix/store/6a2nry90qkr1sh9lfwlsqzmvy4sxvml0-vimrc
  2: /nix/store/lg976fklw8wc4xilfj494v24a3fd3w3q-neovim-unwrapped-0.3.8/share/nvim/runtime/filetype.vim
  3: /nix/store/lg976fklw8wc4xilfj494v24a3fd3w3q-neovim-unwrapped-0.3.8/share/nvim/runtime/ftplugin.vim
  4: /nix/store/lg976fklw8wc4xilfj494v24a3fd3w3q-neovim-unwrapped-0.3.8/share/nvim/runtime/indent.vim
  5: /nix/store/lg976fklw8wc4xilfj494v24a3fd3w3q-neovim-unwrapped-0.3.8/share/nvim/runtime/syntax/syntax.vim
  6: /nix/store/lg976fklw8wc4xilfj494v24a3fd3w3q-neovim-unwrapped-0.3.8/share/nvim/runtime/syntax/synload.vim
  7: /nix/store/lg976fklw8wc4xilfj494v24a3fd3w3q-neovim-unwrapped-0.3.8/share/nvim/runtime/syntax/syncolor.vim
  8: /nix/store/lg976fklw8wc4xilfj494v24a3fd3w3q-neovim-unwrapped-0.3.8/share/nvim/runtime/plugin/gzip.vim
  9: /nix/store/lg976fklw8wc4xilfj494v24a3fd3w3q-neovim-unwrapped-0.3.8/share/nvim/runtime/plugin/health.vim
 10: /nix/store/lg976fklw8wc4xilfj494v24a3fd3w3q-neovim-unwrapped-0.3.8/share/nvim/runtime/plugin/man.vim
 11: /nix/store/lg976fklw8wc4xilfj494v24a3fd3w3q-neovim-unwrapped-0.3.8/share/nvim/runtime/plugin/matchit.vim
 12: /nix/store/lg976fklw8wc4xilfj494v24a3fd3w3q-neovim-unwrapped-0.3.8/share/nvim/runtime/plugin/matchparen.vim
 13: /nix/store/lg976fklw8wc4xilfj494v24a3fd3w3q-neovim-unwrapped-0.3.8/share/nvim/runtime/plugin/netrwPlugin.vim
 14: /nix/store/lg976fklw8wc4xilfj494v24a3fd3w3q-neovim-unwrapped-0.3.8/share/nvim/runtime/plugin/rplugin.vim
 15: /nix/store/p5rd25v0awwdf6gsqr4vj7cirm4kqwpw-neovim-0.3.8/rplugin.vim
 16: /nix/store/lg976fklw8wc4xilfj494v24a3fd3w3q-neovim-unwrapped-0.3.8/share/nvim/runtime/plugin/shada.vim
 17: /nix/store/lg976fklw8wc4xilfj494v24a3fd3w3q-neovim-unwrapped-0.3.8/share/nvim/runtime/plugin/spellfile.vim
 18: /nix/store/lg976fklw8wc4xilfj494v24a3fd3w3q-neovim-unwrapped-0.3.8/share/nvim/runtime/plugin/tarPlugin.vim
 19: /nix/store/lg976fklw8wc4xilfj494v24a3fd3w3q-neovim-unwrapped-0.3.8/share/nvim/runtime/plugin/tohtml.vim
 20: /nix/store/lg976fklw8wc4xilfj494v24a3fd3w3q-neovim-unwrapped-0.3.8/share/nvim/runtime/plugin/tutor.vim
 21: /nix/store/lg976fklw8wc4xilfj494v24a3fd3w3q-neovim-unwrapped-0.3.8/share/nvim/runtime/plugin/zipPlugin.vim
 22: /nix/store/lg976fklw8wc4xilfj494v24a3fd3w3q-neovim-unwrapped-0.3.8/share/nvim/runtime/autoload/dist/ft.vim
 23: /nix/store/lg976fklw8wc4xilfj494v24a3fd3w3q-neovim-unwrapped-0.3.8/share/nvim/runtime/ftplugin/tex.vim
 24: /nix/store/lg976fklw8wc4xilfj494v24a3fd3w3q-neovim-unwrapped-0.3.8/share/nvim/runtime/ftplugin/plaintex.vim
 25: /nix/store/lg976fklw8wc4xilfj494v24a3fd3w3q-neovim-unwrapped-0.3.8/share/nvim/runtime/ftplugin/initex.vim
 26: /nix/store/r569wz6vs8dap1ffkqc98wvphz224021-vimplugin-vimtex-2019-02-10/share/vim-plugins/vimtex/ftplugin/tex.vim                                                                                                           
 27: /nix/store/r569wz6vs8dap1ffkqc98wvphz224021-vimplugin-vimtex-2019-02-10/share/vim-plugins/vimtex/after/ftplugin/tex.vim                                                                                                     
 28: /nix/store/r569wz6vs8dap1ffkqc98wvphz224021-vimplugin-vimtex-2019-02-10/share/vim-plugins/vimtex/autoload/vimtex.vim                                                                                                        
 29: /nix/store/r569wz6vs8dap1ffkqc98wvphz224021-vimplugin-vimtex-2019-02-10/share/vim-plugins/vimtex/autoload/vimtex/util.vim                                                                                                   
 30: /nix/store/lg976fklw8wc4xilfj494v24a3fd3w3q-neovim-unwrapped-0.3.8/share/nvim/runtime/indent/tex.vim
 31: /nix/store/r569wz6vs8dap1ffkqc98wvphz224021-vimplugin-vimtex-2019-02-10/share/vim-plugins/vimtex/indent/tex.vim                                                                                                             
 32: /nix/store/lg976fklw8wc4xilfj494v24a3fd3w3q-neovim-unwrapped-0.3.8/share/nvim/runtime/syntax/tex.vim
 33: /nix/store/r569wz6vs8dap1ffkqc98wvphz224021-vimplugin-vimtex-2019-02-10/share/vim-plugins/vimtex/after/syntax/tex.vim                                                                                                       
 34: /nix/store/lg976fklw8wc4xilfj494v24a3fd3w3q-neovim-unwrapped-0.3.8/share/nvim/runtime/syntax/dot.vim
 35: /nix/store/lg976fklw8wc4xilfj494v24a3fd3w3q-neovim-unwrapped-0.3.8/share/nvim/runtime/syntax/lua.vim
 36: /nix/store/lg976fklw8wc4xilfj494v24a3fd3w3q-neovim-unwrapped-0.3.8/share/nvim/runtime/syntax/gnuplot.vim
 37: /nix/store/lg976fklw8wc4xilfj494v24a3fd3w3q-neovim-unwrapped-0.3.8/share/nvim/runtime/ftplugin/vim.vim
 38: /nix/store/lg976fklw8wc4xilfj494v24a3fd3w3q-neovim-unwrapped-0.3.8/share/nvim/runtime/indent/vim.vim
 39: /nix/store/lg976fklw8wc4xilfj494v24a3fd3w3q-neovim-unwrapped-0.3.8/share/nvim/runtime/syntax/vim.vim
 40: /nix/store/lg976fklw8wc4xilfj494v24a3fd3w3q-neovim-unwrapped-0.3.8/share/nvim/runtime/syntax/vim/generated.vim 

@evanjs
Copy link
Contributor

evanjs commented Sep 24, 2019

This is extremely reassuring if it is simply something in the neovim expression, as I was starting to see multiple packages that were affected.

@Gerschtli
Copy link
Contributor

If you have some valuable input for NixOS/nixpkgs#69373, you can comment it there :)

@timokau
Copy link
Contributor

timokau commented Sep 28, 2019

This can probably be closed, since its not a home-manager issue. Its a dupe of NixOS/nixpkgs#39364 which I've already reported upstream some while ago. Dupes keep popping up, but I don't know what to do about it. Would be great if someone had some spare time and could look into the upstream issue (neovim/neovim#9390).

@evanjs
Copy link
Contributor

evanjs commented Oct 2, 2019

Here's my current workaround for anybody interested, based on this comment.

@timokau
Copy link
Contributor

timokau commented Oct 2, 2019

Interesting, we could probably add something like that to the default plugin handling. Not sure if there would be any negative side-effects though. I'd much prefer it if this could be handled upstream.

@jonringer
Copy link
Contributor

this might be solved by NixOS/nixpkgs#78385

@teto
Copy link
Collaborator

teto commented Dec 4, 2020

closing as a non home-manager issue

@teto teto closed this as completed Dec 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants