Friday, November 17, 2017

Re: syntax files not working in plugin directory

On Saturday, November 11, 2017 at 1:50:10 AM UTC-6, Renato Fabbri wrote:
> I've been using this very minimal syntax highlighting
> scheme for Toki Pona,
> its just an ftdetect which
> sets the ft=tokipona
> and a syntax file that is loaded by vim when
> ft=tokipona:
> https://github.com/ttm/tokipona
>
> I like to keep the ftdetect/ ftplugin/ and syntax/
> inside ~/.vim/plugin/tokipona/
> (such as by doing
> $ git clone https://github.com/ttm/tokipona ~/.vim/plugin/
> )
> For some reason,
> the syntax file is only loaded if inside
> ~/.vim/syntax/ (not if inside ~/.vim/plugin/tokipona/syntax/).
> But both the ftdetect and ftplugin are triggered inside
> the plugin directory as expected.
>
> Am I missing something?
> The syntax file should be loadable from
> the plugins directory, right?
> How?
>
> +tx,

The "plugin" directory is NOT the correct place to put syntax files, and it is NOT expected to work. I don't think it ever should have worked, but maybe in some old version there is a bug that allows it to.

The "plugin" directory is intended for scripts which always run at every Vim startup.

If you want to keep everything together in one directory, then you need to use Vim's "packages" feature. Clone the repository into a folder like this instead:

$ git clone https://example.com/plugin_name ~/.vim/pack/whatever_you_like/start/plugin_name

I.e. you should end up with folders like:

~/.vim/pack/whatever_you_like/start/plugin_name/syntax
~/.vim/pack/whatever_you_like/start/plugin_name/ftdetect
~/.vim/pack/whatever_you_like/start/plugin_name/plugin
~/.vim/pack/whatever_you_like/start/plugin_name/autoload

etc.

--
--
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: