-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
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
vim_configurable: unable to use plugin syntax files #39364
Comments
I found a way to work around this. I added a symlink to the relevant syntax file in my user vim config: ln -s \
/run/current-system/sw/share/vim-plugins/haskell-vim/syntax/haskell.vim \
~/.vim/syntax/haskell.vim This works because I was mystified for a while as to why |
I encountered the same problem. As far as I understand the situation, this is a bug ''
set packpath-=~/.vim/after
set packpath+=${packDir packages}
set packpath+=~/.vim/after
'' where I checked the code of one of the top "classical" Vim plugin managers — Vundle — and it prepends the user plugins at the beginning of rtp, with let paths = map(copy(g:vundle#bundles), 'v:val.rtpath')
let prepends = join(paths, ',')
let appends = join(paths, '/after,').'/after'
exec 'set rtp^='.fnameescape(prepends)
exec 'set rtp+='.fnameescape(appends) (Only the explicitly named The behavior of Vundle also matches the semantics of the default value of rtp (a.k.a. runtimepath) on Unix as specified in Vim manual:
I was hit by this problem when trying to load the EDIT: After some more digging, I believe this is actually just how neovim (and vim8?) behaves. I don't understand why it's so. I forked nixpkgs and changed the snippet to: ''
set packpath^=${packDir packages}
'' but the plugin directories are still appended at the end of My current workaround is to add the following string at the beginning of my .vimrc: let
loadPlugin = plugin: ''
set rtp^=${plugin.rtp}
set rtp+=${plugin.rtp}/after
'';
in ''
" Workaround for broken handling of packpath by vim8/neovim for ftplugins
filetype off | syn off
${builtins.concatStringsSep "\n"
(map loadPlugin plugins)}
filetype indent plugin on | syn on
'' |
@akavel workaround works for me, I got caught by this when my python-mode vim plugin wasn't working here is my config, which works file: |
I created the issue #52722, which I now realize is a duplicate. I also created a report upstream, which may be interesting for the people here. If you have any additional info, please add it there: neovim/neovim#9390 |
I followed @akavel's workaround as per @Azulinho's example, but I kept getting errors about duplicate entries in the runtimepath. The fix is to not set |
The problem here is that the default runtimepath includes The good news is that directories can be included in the default runtimepath before I don't know if there's a clean way to do this if the interface is to be preserved. I managed to get things working with the Ultimately, I think breaking changes need to be made if we want clean code. P.S. I believe this is also the cause of LnL7/vim-nix#11, to mentioned another issue. |
What do traditional plugin managers like vim-plug differently then? |
I'm not too familiar with the internals of these package managers, but, looking at vim-plug, it does quite a bit to ensure that the user-specified plugins are loaded correctly. The take-away is that it's modifying the runtimepath directly. If you want to go that route, akavel's solution (#39364 (comment)) is nice and simple. |
…#issuecomment-425536054
plugin syntax files did not work with neovim installed with nix package manager . ## References - neovim/neovim#9390 - NixOS/nixpkgs#39364 (comment) - NixOS/nixpkgs#78385
As far as I can tell, the fix only applied to vim proper, not neovim. Should that be a separate issue or can we re-open this? (Or am I holding it wrong?) |
Issue description
Using vim-configurable to bake plugins into a system-wide vim configuration, there doesn't appear to be a way to make a plugin's syntax files precede those in $VIMRUNTIME. Since most syntax files contain a guard-clause to avoid clobbering any previously-set syntax, such plugins can't have the desired effect.
I'm using Vim 8 packages to bake haskell-vim (plus some other plugins) into my system-wide vim configuration. I have an overlay that contains:
The haskell-vim plugin contains a syntax file. A less feature-rich syntax file also exists at $VIMRUNTIME/syntax/haskell.vim. Both files begin with a guard-clause:
and end with
so whichever runs first wins.
I want to use haskell-vim's syntax file, but the way vim_configurable works, I end up with a runtimepath like:
I'm trying to figure out how I could bump this particular plugin to an earlier position in runtimepath, whether it makes sense to bump the whole package (all plugins), or whether there's some other solution.
Technical details
The text was updated successfully, but these errors were encountered: