Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vimtex cannot detect mathzone in vimwiki markdown file #1378

Open
4 tasks done
fenuks opened this issue Nov 5, 2023 · 0 comments
Open
4 tasks done

vimtex cannot detect mathzone in vimwiki markdown file #1378

fenuks opened this issue Nov 5, 2023 · 0 comments
Labels
enhancement markdown Problems specific to markdown syntax syntax Related to syntax and highlighting

Comments

@fenuks
Copy link

fenuks commented Nov 5, 2023

  • Include the VimWiki settings from your .vimrc
" min.vim
filetype indent plugin on
syntax on
call plug#begin('~/.local/share/nvim/plugged')
  Plug 'https://github.com/vimwiki/vimwiki', { 'branch': 'dev' }
let g:vimwiki_list = [{'path': '/tmp/vimwiki',
                       \ 'syntax': 'markdown', 'ext': '.md'}]
  Plug 'https://github.com/lervag/vimtex'

  " show syntax groups at the cursor
  nnoremap <unique> <silent> <F2> :echo map(synstack(line('.'), col('.')), 'synIDattr(v:val, "name")')<CR>
call plug#end()
  • Include the syntax you are using (default / Markdown / MediaWiki)
    markdown, see the minimal vim file above
  • Provide a detailed description of the problem including steps to reproduce the issue.
    I'm not certain if this in intended or not, but vimwiki doesn't set texMathZone syntax group. Other plugins like https://github.com/preservim/vim-markdown or https://github.com/vim-pandoc/vim-pandoc-syntax use it, and I can see many colourschemes support it, so it might be worth adding in vimwiki as well.

With file opened with nvim -u min.vim test.md

$HERE$
\( HERE \)
\[ HERE \]
$$ HERE $$

in all lines with cursor inside math block echo vimtex#syntax#in_mathzone() returns 0. This function is commonly used to add context-sensitive tex snippets that trigger only when it makes sense.

For reference, definition of in_mathzone can be seen here.

  • Include the output of :VimwikiShowVersion.
Version: 2023.05.12
Os: Linux
Vim: 801
Branch: dev
Revision: 0bb1b49
Date: 2023-10-31 13:45:18 -0300
@brennen brennen added enhancement markdown Problems specific to markdown syntax syntax Related to syntax and highlighting labels Jan 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement markdown Problems specific to markdown syntax syntax Related to syntax and highlighting
Projects
None yet
Development

No branches or pull requests

2 participants