Tuesday, June 22, 2021

Re: syntaxcomplete#Complete() and nested filetypes

On 2021-06-22, David Fishburn <dfishburn.vim@gmail.com> wrote:
> Life,
>
> I am not sure I quite understand your use case for the plugin.

Thanks for the feedback. My goal is to have some sort of
context-sensitive completion. My use case is ConTeXt, which can include
MetaPost blocks:

\starttext
TeX code here: filetype is `context`
\startMPcode
% Nested filetype here is `mp`.
% MetaPost code here.
% Only `mpSomething` syntax groups should be used for
% completion.
\stopMPcode
TeX code again: filetype is again `context`.
Only `contextSomething` syntax groups should be used.
\stoptext

Within the ...MPcode block, where a nested filetype is active, I'd like
completion only for that filetype. AFAICT, I can add MetaPost syntax
groups using omni_syntax_group_include_context, but they will be active
throughout the buffer.

The snippet I have posted allows me to do that sort of context-sensitive
completion, but maybe there is a better/more efficient way.

Thanks,
Life.

--
--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/sas9l7%244pe%241%40ciao.gmane.io.

No comments: