### 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.

Example:

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
outdated).
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
\begin{command}
x
\end{command}<++>
{eno:command}  Environment with option:
\begin[x]{command}
<++>
\end{command}<++>
{ens:command[<<option>>]...}  Environment special:
\begin[<<option>>]...{command}
<++>
\end{command}<++>
{bra:command} Brackets:
\command{x}<++>
{brd:command} Brackets double:
\command{x}{<++>}<++>
{brs:command[<<option>>]...} Brackets special (as environment special:
\command[<+x+>]{<++>}{<++>}<++>
{nor:command} Normal:
\command<Space
{noo:command} Normal with option:
\command[x]<++>
{nob:command} Normal with option and brackets:
\command[x]{<++>}<++>
{pla:command} Plain:
command<Space
{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
\command