From 550672834707a587900a3c18dbba219b8dfe6d59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20Yngve=20Lerv=C3=A5g?= Date: Tue, 25 Oct 2016 20:31:13 +0200 Subject: [PATCH] Cf. #566: Add documentation --- doc/vimtex.txt | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/doc/vimtex.txt b/doc/vimtex.txt index e234123..32f7f5d 100644 --- a/doc/vimtex.txt +++ b/doc/vimtex.txt @@ -1356,7 +1356,8 @@ dictionary argument: > \ 'lhs' : lhs, \ 'rhs' : rhs, \ 'leader' : leader_key, - \ 'wrapper' : function_name + \ 'wrapper' : function_name, + \ 'context' : value, \ } Explanation of the keys: @@ -1375,15 +1376,25 @@ Explanation of the keys: The name of a wrapper function that is used to generate the `rhs`. Two functions are available from |vimtex|: - `vimtex#imaps#wrap_trivial` Trivial wrapper: Simply returns `rhs`. - `vimtex#imaps#wrap_math` Only define `rhs` if inside a math environment. - This is the default wrapper function and will - be used if no other wrapper is supplied. + `vimtex#imaps#wrap_trivial` + Trivial wrapper: Simply returns `rhs`. + + `vimtex#imaps#wrap_math` + Only define `rhs` if inside a math environment. This is the default + wrapper function and will be used if no other wrapper is supplied. + + `vimtex#imaps#wrap_environment` + Only define `rhs` if inside one of the environments specified through + a list of environment names. The list must be supplied through the + `context` key. Of course, one may use custom wrapper functions. To write a custom wrapper function, please see the source for examples on how the |vimtex| wrappers are written. + context~ + A value that can be used by the chosen wrapper function. + *vimtex-neosnippet* *vimtex-UltiSnips* Note: that this feature is not the same as the snippet feature of |UltiSnips|