Comments (3)
I believe the problem is quite simple. You forgot to unlet b:current_syntax
. This should work, I think:
if exists('b:current_syntax')
finish
endif
runtime! syntax/markdown.vim
unlet b:current_syntax
" Include tex math in markdown
syn include @tex syntax/tex.vim
syn region mkdMath start="\\\@<!\$" end="\$" skip="\\\$" contains=@tex keepend
syn region mkdMath start="\\\@<!\$\$" end="\$\$" skip="\\\$" contains=@tex keepend
let b:current_syntax = 'markdown'
from vimtex.
@lervag That does not work, also the b:_loaded_markdown_syntax
is needed to avoid the endless recursive of sourcing syntax/markdown.vim
files, so this is the content in my current ~/.config/nvim/syntax/markdown.vim
:
if exists('b:current_syntax') || exists('b:_loaded_markdown_syntax')
finish
endif
let b:_loaded_markdown_syntax = 1
runtime! syntax/markdown.vim
unlet b:current_syntax
" Include tex math in markdown
syn include @tex syntax/tex.vim
syn region mkdMath start="\\\@<!\$" end="\$" skip="\\\$" contains=@tex keepend
syn region mkdMath start="\\\@<!\$\$" end="\$\$" skip="\\\$" contains=@tex keepend
let b:current_syntax = 'markdown'
and this is what I get -- all highlighting in markdown math zone disappears (e.g. it does not make a difference before/after adding unlet b:current_syntax
). Can you repro? Thanks!
from vimtex.
I've also tried moving the syntax file to the after/syntax
directory with only the following content to avoid sourcing nvim's default markdown syntax file manually:
syn include @tex syntax/tex.vim
syn region mkdMath start="\\\@<!\$" end="\$" skip="\\\$" contains=@tex keepend
syn region mkdMath start="\\\@<!\$\$" end="\$\$" skip="\\\$" contains=@tex keepend
but that does not give me math conceal in mathzones. Don't know why but the conceal works only if
- the tex syntax is included in
syntax/markdown.vim
, notafter/syntax/markdown.vim
, and - the default markdown syntax file must not be sourced in
syntax/markdown.vim
So it seems that the math concealing works only if nvim does not source the default markdown syntax file. I'm confused.
from vimtex.
Related Issues (20)
- Use new synctex interactive mode to speed up synctex HOT 5
- Toggle to revert changes made in issue 2401 HOT 2
- Mainfile detection fails when \input is in enumerate environment HOT 4
- l:file not defined in function vimtex#compiler#compile_selected(type) HOT 4
- Setup text argument in user-defined command HOT 3
- Wrong TeXMathZone result from `vimtex#syntax#stack()` HOT 5
- Compilation failed when using xelatex HOT 2
- Compilation fail with option "-c" HOT 10
- Can't open .tex files... sort of? HOT 3
- Zathura issues with finding Window ID HOT 2
- Disabling "latexmk is not executable" message on startup HOT 3
- Cannot create directory: file already exists error when compiling HOT 7
- Continuous mode for OpenBSD fails due to option HOT 8
- citekey: link to BibDesk HOT 1
- Concealing subscript letters stopped working HOT 4
- [help] Is there possible way for another plugin to get mainfile path that vimtex finds? HOT 1
- Viewer (evince) opening on top of neovim instance instead of new window HOT 1
- Support for nofile buffers (e.g. AirLatex) HOT 3
- inverse search not working WSL HOT 9
- Inline math environment not detected as text object HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vimtex.