Thursday, November 17, 2016

Re: How to load updated syntax files using native packages?

On Wednesday, November 16, 2016 at 11:57:57 AM UTC-6, Dugan Chen wrote:
> I've been experimenting with native packages (~/.vim/pack/me/start/{repo1,repo2}, and I've noticed that they don't seem to support plugins that include syntax files that are meant to override the ones included with vim. An example would be most of vim-polyglot.
>
> If I add a package containing an updated syntax file for, say, Python, then vim will not see the updated syntax file and will always use the one that it shipped with.
>
> What I think is happening is this. Vim starts with the directories containing its shipped syntax files in the runtime path. When it loads each package, it appends that package to the runtime path. When you load a Python file, it searches the runtime path from start to end for a Python syntax file, finds its stock syntax file first, and uses that.
>

That's not how it works, though.

Vim *inserts* the package directories prior to the distributed runtime files. So it *should* find your package syntax files first.

Are you sure vim-polyglot is actually coming after your distribution files? Are you sure you don't have a syntax file in your ~/.vim directory (which IS before the package files)? Are you sure vim-polyglot sets the appropriate flag to prevent itself from being overridden by the built-in files?

Posting your actual 'runtimepath' may help. Also see the output of the :scriptnames command after loading your python file to see which scripts got sourced and in which order.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: