Luc Hermitte's VIM LaTeX ftplugins | Monday 25th August 2003 |
All the files that follow are for VIM version 6.0+ only. Instead of having one big file, I have collected several mappings, functions and ideas from different sources, arranged them to fit my needs and my taste, and split them into several thematic files.
This way, it becomes easier to maintain the whole stuff : ones can download the LaTeX tools ftplugin and bind the different functionalities to his favorite keystrokes ; without having to rebind everything every time a new version of the ftplugin is out. On the other hand, the number of files can gives an justified impression of complexity. It may be annoying to install the whole stuff the first time, but on the long run it's worth the price.
You could also only download lh-tex.tar.gz [27th January 2004] that contains all the files presented on this page plus the plugins they required and some other bonuses you could find elsewhere like on sourceforge.
tex-set.vim <raw file> help on : <C-F1> |
This file is required by different other TeX ftplugins : it
defines some commands that ease the definition of menus and
mappings in one function call (acts as a wrapper to menu-map.vim ).It also defines different settings (VIM's options) plus mappings and menus that ease the insertion of different LaTeX commands (mainly font attributes) and environments. Like html_set.vim , the macros defined are also
available in both normal and visual mode. Moreover, they are
quite the same. And this time again, the set of mappings is not
exhaustive.Requires help.vim (facultative), menu-map.vim , common_brackets.vim ,
compiler/tex.vim ,
vim-tex.sh (recommended), and
misc_map.vim .
|
|
tex-macros.vim <raw file> |
This file is a compilation of functions dedicated to the
insertion of different environments and sections. Initially
these functions have been writen by Ralf Arens and Tomer
Kol. I have slightly patched them to :
tex-macros.vim can be found in
tex-maps.vim .
|
|
tex-maps.vim <raw file> help on : <C-L><F1> |
This file defines several mappings plus the menus and the help
messages associated. The mappings : - call the different tools
(from tex-tools.vim ), insert environments
(tex-macros.vim ), and ease the navigation through
LaTeX errors. A callback function for the extended modeline functionality is also defined : it permits to define the name of the main file for the current document. Built on top of : tx_macros.vim and
TKLaTeX.vim .
|
texmenus.vim <raw file> |
The texmenus file defined and maintained by other people, but with specific alterations to fit my taste and my keyboard. I still have future plans for this file. |
tex-smart_chars.vim <raw file> |
This file is a compilation of other well known smart mappings
for LaTeX. You will found in this file :
... ,
but \etc instead. Smart-underscore can take advantage of common_brackets.vim , and misc_map.vim if
installed.
|
tex-tools.vim <raw file> |
Here is a big piece of ftplugin.
It defines commands that will compile LaTeX files, transform
them and view the results. Well quite common, isn't it ?
Except that it checks dependencies (tex->dvi->ps &
other combinaisons involving pdf) ; re-run latex if references
have changed (number of pages, labels, etc) ; run
bibtex if there are bibliographic entries ; run makeindex if
needed. May be not every possible case is taken into account,
but a lot are.
This version has been tested under a PC under WindowsNT with
Zsh and cmd32 -- I had some troubles with my installation of
cygwin-bash to run ps2pdf. I strongly recommend you use vim-tex.sh (my little patch for e/=\(pdf\)\=\(la\)\=tex over Srinath Avadhanula shell script) to filter error messages -- facultative nevetheless. And you have to use "my" version of compiler/tex.vim -- or at least a version that defines the command TeXSetEFM in order to assign the errorformat option of vim.
|
|
tex.vim <raw file> |
This is the tex compiler file defined by Artem Chuprina and
then customized by Srinath Avadhanula. My contribution is to
define a command (TeXSetEFM ) that could be invoked
without needing to re-source the file. Why ? because latex
needs one errorformat, while bibtex, makeindex, dvips and
ps2pdf need other particular values for this VIM setting.
|
|
vim-tex.sh <raw file> |
This shell script pre-parses latex errors before VIM parses
them again. This is just a little patch over Srinath
Avadhanula's version in order to be able to execute other
programs than latex (like pdftex, etex, etc.).
I also tried to find a way to return the shell error from latex
(/the first compilation tool executed).
Don't forget to correct the first line of the script to match the location of your bourne-shell interpreter. |
Some settings
Commands for other tex ftplugin (help & menu+map)
Command for customizing the character delimiter used by
\verb
Loads my spellchecker plugin
Generic menu & maps (+ help messages) to insert different LaTeX
commands and environments ; they work in the three modes (insert, visual
and normal) and an exhaustive list can be obtained by hitting
<C-F1>
-- help.vim
required.
In the future, different things may fusion with texmenus.vim
Some features en vrac...
s:TKSetDefaultProgNames()
, to be sure your environment
matches the default programs I propose.
<{main-file-name}.latexmain>
; - or by setting the
global variable : g:TeXfile
(my let-modeline plugin can be
of a great help with this approach).
Can support Benji Fisher's aux2tags.vim
ftplugin if found on
the system ; i.e. provide a keybinding to directly invoke the
parser command.
Can support Michael Geddes's bufferoption.vim
plugin if found
on the system and if desired (g:want_buffer_menu_for_tex ==
1
).
Provides two new commands used by itself and texmenus.vim
to
ease the definition of buffer-relative mappings and menus.
Back to the ftplugins page | hermitte at free.fr |