vimtex/test/vader/imaps.vader
2016-04-10 22:44:52 +02:00

55 lines
1.0 KiB
Plaintext

Execute (Setup):
let g:vimtex_imaps_leader = ';'
let g:vimtex_imaps_disabled = ['a']
call vimtex#imaps#add_map({'lhs' : 'vv', 'rhs' : '\vec{'})
call vimtex#imaps#add_map({
\ 'lhs' : 'test',
\ 'rhs' : 'tested',
\ 'leader' : '',
\ 'wrapper' : 'vimtex#imaps#wrap_trivial',
\})
silent! VimtexReload
Given:
Given tex (Minimal tex file):
\documentclass{minimal}
\begin{document}
\end{document}
Do (imaps: some default maps):
jo$;; ;b$
Expect tex (Verify):
\documentclass{minimal}
\begin{document}
$; \beta$
\end{document}
Do (imaps: imaps_disabled):
jo$a = ;a$
Expect tex (Verify):
\documentclass{minimal}
\begin{document}
$a = ;a$
\end{document}
Do (imaps: imaps#add_map test -> tested):
jotest
Expect tex (Verify):
\documentclass{minimal}
\begin{document}
tested
\end{document}
Do (imaps: imaps#add_map ;vv -> \vec{f}):
jo$|f| = ;vvf}\cdot;vvf}$ --- ;vv
Expect tex (Verify):
\documentclass{minimal}
\begin{document}
$|f| = \vec{f}\cdot\vec{f}$ --- vv
\end{document}