Shougo / context_filetype.vim

Context filetype library for Vim script
Other
160 stars 20 forks source link

Using syntax completion inside a markdown block #47

Closed physicophilic closed 3 years ago

physicophilic commented 3 years ago

Hi Shougo

Please help me - I tried all I could think of, but couldn't get this done.. I am using your neco syntax for filename.m files and getting completion with deoplete all right. I also confirm that context_filetype plugin works well with deoplete-jedi within markdown like this

markdown

``` python # python complete works here with jedi ```

My problem

When I use the filetype (mathematica) mma associated with files filename.m,

markdown

``` mma syntax completion doesn't work here ```

I have tried adding (after reading some of the questions here)

call deoplete#custom#source('omni', 'functions', {
\ 'mma': ['syntaxcomplete#Complete']
\})

to my init.vim, but it doesn't work. I don't know what I should do!

And more importantly, thank you so much for your plugin. Your work is awesome!

Shougo commented 3 years ago

Because both neco-syntax and syntaxcomplete use current :syntax list output. In markdown syntax, mathematica syntax is not included!

No magic.

Shougo commented 3 years ago

I think it works for you. https://github.com/osyo-manga/vim-precious

physicophilic commented 3 years ago

Arigatou! It does work. So happy :)

Shougo commented 3 years ago

It may be slow though. Because it changes filetypes dynamically.

physicophilic commented 3 years ago

It is still very useful... I don't use code in markdown very often so I might be fine.

I still haven't made full switch to neovim, and when I do, this will be even more useful I think.

Also, I currently have poor knowledge of autocompletion, so if I find it to be slow, I will try to learn more about it! Probably with this exposure I would be more confident of dealing with it!

Thank you Shougo-san :)