76 lines
1.4 KiB
Plaintext
76 lines
1.4 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',
|
|
\})
|
|
call vimtex#imaps#add_map({
|
|
\ 'lhs' : 'cool',
|
|
\ 'rhs' : '\item',
|
|
\ 'leader' : '',
|
|
\ 'wrapper' : 'vimtex#imaps#wrap_environment',
|
|
\ 'context' : ["itemize", "enumerate"],
|
|
\})
|
|
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}
|
|
$|f| = \vec{f}\cdot\vec{f}$ --- ;vv
|
|
\end{document}
|
|
|
|
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}
|
|
|