Home > tex.vim

tex.vim

Tex.vim is a project mainly written in Vim Script, it's free.

LaTeX macros in Vim (which emulate operator-pending mode operations)

This is a mirror of http://www.vim.org/scripts/script.php?script_id=93

This file type plugin intended provides some insert mode macros for the LaTeX typesetting language. The nice thing about these mappings is that they emulate the operator pending mode in the insert mode. i.e, the user does NOT have to type the LHS in a hurry or without making mistakes. This facilitates using the macros greatly.

See below for the detailed list of macros provided or just browe the file after downloading it. In brief, this file provides stubs for the most commonly used typsetting commands such as figures, matrices etc. As an example, the commonly used matrix element is provided. Typing

mat

in the insert mode will expand to the following familiar matrix element:

left[ egin{array}{_} end{array} ight]

with the cursor placed where the underscore is shown (note the underscore is not part of the macro, it just shows the cursor placement) NOTE: is part of the LHS of the mapping. however, the characters need NOT be typed in quick succession as in most insert mode commands.

See the section "ADDING" in the file in order to modify/add new mappings.

A quick way to enter greek symbols is also provided. For example, typing 'q' will expand to heta. (NOTE: quotes are not part of the LHS). See the section "SYMBOLS" in the file for adding/modifying the way the greek alphabet is mapped into the english alphabet. Again can be conviniently pressed after a long time or after moving around and coming back.

a few other shortcuts: == expands to &=& (useful while writing eqnarrays) $$ expands to $$ but the cursor is repositioned before the last $ (so you dont have to go back) expands to {} ^ expands to ^{}

============================================================================ LIST OF AVAILABLE MACROS

  1. TABLE: tab egin{table} centering egin{tabular}{-}

end{tabular} label{tab:} caption{} end{table}

  1. ARRAY: bar left egin{array}{-}

end{array} ight

  1. ENUMERATE: ben egin{enumerate} item - end{enumerate}

  2. ITEMIZE: bit egin{itemize} item - end{itemize}

  3. EQUATION: beq egin{equation}

    end{equation}

  4. EQUATION ARRAY: bqn egin{eqnarray}

    end{eqnarray}

  5. EPS FIGURE: bfg egin{figure}[h] centerline{psfig{figure=-.eps}} caption{} label{fig:} end{figure}

  6. EMPTY FIGURE: bfe egin{figure} vspace{-} caption{} end{figure}

  7. TABULAR: btb egin{tabular}{-}

end{tabular}

  1. TABLE: bta egin{table} centering egin{tabular}{-}

end{tabular} label{tab:} caption{} end{table}

  1. PICTURE: pic egin{picture}(4,4) put(0.5,0){framebox(4,4){-}} end{picture}

  2. MATRIX: mat left[ egin{array}{-} end{array} ight]

  3. FRAC: frac frac{-}{}

  4. DOT: dot dot{-}

  5. DOUBLE DOT: ddot ddot{-}

Previous:unilatex.vim