lervag / vimtex

VimTeX: A modern Vim and neovim filetype plugin for LaTeX files.
MIT License
5.53k stars 390 forks source link

Feature request: support latex math completion in markdown #1183

Closed znculee closed 6 years ago

znculee commented 6 years ago

I'm curious about how did you implement the completion of latex in vimtex, but I'm very appreciate the the latex math completion in YCM. However, I also write latex equations in markdown, and do you know how an I activate the latex math completion in markdown file? By the way, I'm using plasticboy/vim-markdown, and what markdown plugin do you recommend? @lervag @clason

clason commented 6 years ago

I'm using https://github.com/ncm2/ncm2, which I'm very happy with. I don't write markdown, so I can't help you there, but ncm2 supports subscopes (https://github.com/ncm2/ncm2-markdown-subscope), so it might be possible (but then you need to workaround this issue because with the current setup, the vimtex regex for triggering autocomplete aren't available to ncm2 unless the filetype is set to tex).

znculee commented 6 years ago

Thank you very much for your help.

lervag commented 6 years ago

Thanks, @clason!

I do write some markdown myself, and I also use plasticboys plugin. I've not yet tried the subscoped completion, but I am going to look into it myself when I get the time.

clason commented 6 years ago

@lervag Let me know how it turns out! I imagine the subscoping can be quite useful in other contexts (literate programming in, e.g., python).

Depending on how involved the math you're writing is, the LaTeX-to-Unicode functionality of https://github.com/JuliaEditorSupport/julia-vim (which also supports tab completion and can be enabled independently of the julia FileType) might also be useful for Markdown.