2016-04-10 15:47:14 -04:00
|
|
|
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',
|
|
|
|
\})
|
2016-04-10 16:44:52 -04:00
|
|
|
silent! VimtexReload
|
2016-04-10 15:47:14 -04:00
|
|
|
|
2016-04-10 16:44:52 -04:00
|
|
|
Given:
|
2016-04-10 15:47:14 -04:00
|
|
|
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}
|
|
|
|
|