vimtex/test/vader/imaps.vader

76 lines
1.4 KiB
Plaintext
Raw Permalink Normal View History

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-10-17 16:35:04 -04:00
call vimtex#imaps#add_map({
\ 'lhs' : 'cool',
\ 'rhs' : '\item',
\ 'leader' : '',
\ 'wrapper' : 'vimtex#imaps#wrap_environment',
\ 'context' : ["itemize", "enumerate"],
\})
2016-04-10 16:44:52 -04:00
silent! VimtexReload
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}
2016-05-31 06:58:37 -04:00
$|f| = \vec{f}\cdot\vec{f}$ --- ;vv
\end{document}
2016-10-17 16:35:04 -04:00
Do (imaps: imaps#add_map cool -> \item):
jocool\<cr>
\begin{itemize}\<cr>
cool\<cr>
\end{itemize}
Expect tex (Verify):
\documentclass{minimal}
\begin{document}
cool
\begin{itemize}
\item
\end{itemize}
\end{document}