sponsor Vim development Vim logo Vim Book Ad

tex_autoclose.vim : TeX / LaTeX ftplugin to automatically close environments

 script karma  Rating 60/28, Downloaded by 3307  Comments, bugs, improvements  Vim wiki

created by
gi1242 gi1242
 
script type
ftplugin
 
description
Provides mappings to automatically close environments.

Pressing "\c" in normal mode (or <C-\>c in insert mode) will cause the last open environment to be closed. (If a fold is started on the \begin{env} line, then it will be automatically closed on the \close{env} line.)

Also pressing "<C-\>}" in insert mode when the cursor is at the end of a "\begin{environment}" will automatically generate a "\close{environment}". It will leave the cursor at the end of the "\begin{environment}" (in insert mode), so that the user can enter arguments [if any].

Small and functional. Suggestions welcome.

Git-hub page: https://github.com/gi1242/vim-tex-autoclose
 
install details
drop the script into your $VIMRUNTIME/ftplugin directory for global instalation.
Put it in ~/.vim/ftplugin for local installation.
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
tex_autoclose.vim 1.3 2014-11-05 7.3 gi1242 gi1242 Fixed indent of end environments, and exposed API for ab-prefix plugin.
tex_autoclose.vim 1.2 2009-03-25 7.0 gi1242 gi1242 Disabled "}" auto closing environments by default. This ruined the change history (and didn't account for fold markers). Provided "<C-\>c" to close the last open environment. (Also fix a UTF8 bug, thanks to Molin Pascal)
tex_autoclose.vim 1.1 2004-04-09 6.0 gi1242 gi1242 Now pressing "}" in insertmode will show the matching "{". No other functionality has been modified.
tex_autoclose.vim 1.01 2004-03-12 6.0 gi1242 gi1242 Disabled the mapping "\}". To insert a literal "}" in latex, you have to use "\}", which conflicts with this mapping. If you do NOT want "}" to automatically close an environment, use "^V}"
tex_autoclose.vim 1.0 2004-02-23 6.0 gi1242 gi1242 Initial upload
ip used for rating: 3.15.3.154

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
Vim at Github