4.4 Writing supporting for a package

4.4.1 g:Tex_package_option_<package>
4.4.2 g:Tex_package_<package>

Supporting a package is easy and consists of writing a vim script with the same name as the package and placing it in the $VIM/ftplugin/latex-suite/packages directory. A package script should define two variables as described in the next two sections. In addition to these two variables, you can also define any functions, environment definitions etc. in this file.

4.4.1 g:Tex_package_option_<package>

This setting is a string containing a comma separated list of options supported by this package.


g:Tex_package_option_mypack = 'opt1,opt2=,sbr:group1,opt3,opt4'

The = suffix means that the option takes a value. Use sbr:group name to separate options into sub-menus. All successive options will be clubbed into the group1 sub-menu till the next sbr: option is encountered.

4.4.2 g:Tex_package_<package>

    g:TeX_package_<package> = "pre:Command,pre:Command1"
More detailed example is in latex-suite/packages/exmpl file (slightly
Here is short summary of prefixes which can be used in package files:
(x - place with cursor, <++> - |placeholder|)

{env:command}  Environment: creates simple environment template
{eno:command}  Environment with option:
{ens:command[<<option>>]...}  Environment special:
{bra:command} Brackets:
{brd:command} Brackets double:
{brs:command[<<option>>]...} Brackets special (as environment special:
{nor:command} Normal:
{noo:command} Normal with option:
{nob:command} Normal with option and brackets:
{pla:command} Plain:
{spe:command} Special:
            command   <-literal insertion of command
{sep:command} creates separator. Good for aesthetics and usability :)
{sbr:command} Breaks menu into submenus. <command> will be title of submenu.
            Can be used also in package variable.

Command can be also given without prefix:. The result is