-
Notifications
You must be signed in to change notification settings - Fork 390
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add test files for g:vimtex_syntax_custom_envs
- Loading branch information
Showing
2 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
\documentclass{minimal} | ||
|
||
\usepackage{listings} | ||
\lstnewenvironment{code}[1][]{\lstset{#1}}{} | ||
\lstnewenvironment{python_code}{\lstset{language=python}}{} | ||
|
||
\begin{document} | ||
|
||
\begin{MyMathEnv} | ||
f(x) = 1 | ||
\end{MyMathEnv} | ||
|
||
\begin{python_code} | ||
def test(argument: str) -> str: | ||
""" | ||
Test function. | ||
""" | ||
return argument | ||
\end{python_code} | ||
|
||
\begin{code}[language=rust] | ||
fn main() { | ||
println!("Hello World!"); | ||
} | ||
\end{code} | ||
|
||
\end{document} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
source common.vim | ||
|
||
let g:vimtex_syntax_custom_envs = [ | ||
\ {'name': 'MyMathEnv', 'mathmode': 1}, | ||
\ {'name': 'python_code', 'nested': 'python'}, | ||
\ { | ||
\ 'name': 'code', | ||
\ 'nested': { | ||
\ 'python': 'language=python', | ||
\ 'c': 'language=C', | ||
\ 'rust': 'language=rust', | ||
\ }, | ||
\ }, | ||
\] | ||
|
||
Edit test-custom-envs.tex | ||
|
||
if empty($INMAKE) | finish | endif | ||
|
||
call vimtex#test#finished() |