vim: highlight markdown-style code fences

e.g.
```tex
did you know $\frac29 == \frac4{18}$ ?
```
This commit is contained in:
2022-08-25 00:17:33 -07:00
parent e54af3f571
commit c6485a5e42

View File

@@ -386,6 +386,14 @@ in
vim-surround vim-surround
# docs: fzf-vim (fuzzy finder): https://github.com/junegunn/fzf.vim # docs: fzf-vim (fuzzy finder): https://github.com/junegunn/fzf.vim
fzf-vim fzf-vim
({
plugin = vim-SyntaxRange;
type = "viml";
config = ''
" enable markdown-style codeblock highlighting for tex code
autocmd BufEnter * call SyntaxRange#Include('```tex', '```', 'tex', 'NonText')
'';
})
# nabla renders inline math in any document, but it's buggy. # nabla renders inline math in any document, but it's buggy.
# https://github.com/jbyuki/nabla.nvim # https://github.com/jbyuki/nabla.nvim
# ({ # ({
@@ -396,6 +404,7 @@ in
# ''; # '';
# }) # })
# treesitter syntax highlighting: https://nixos.wiki/wiki/Tree_sitters # treesitter syntax highlighting: https://nixos.wiki/wiki/Tree_sitters
# docs: https://github.com/nvim-treesitter/nvim-treesitter
# config taken from: https://github.com/i077/system/blob/master/modules/home/neovim/default.nix # config taken from: https://github.com/i077/system/blob/master/modules/home/neovim/default.nix
# this is required for tree-sitter to even highlight # this is required for tree-sitter to even highlight
({ ({
@@ -405,7 +414,12 @@ in
require'nvim-treesitter.configs'.setup { require'nvim-treesitter.configs'.setup {
highlight = { highlight = {
enable = true, enable = true,
disable = {} -- disable treesitter on Rust so that we can use SyntaxRange
-- and leverage TeX rendering in rust projects
disable = { "rust", "tex", "latex" },
-- disable = { "tex", "latex" },
-- true to also use builtin vim syntax highlighting when treesitter fails
additional_vim_regex_highlighting = false
}, },
incremental_selection = { incremental_selection = {
enable = true, enable = true,