If you're using Vim-LaTeX with Vim 7 or higher, you may want make sure you have this somewhere in your .vimrc:
Otherwise, some of your .tex files will not automatically kick off vim-latex on opening! In particular, vim-latex is usually only loaded if Vim finds a \documentclass, \begin, or \usepackage in the first 1000 uncommented lines of a .tex file. This change forces it to load for all .tex files." Prevents Vim 7.0 from setting filetype to 'plaintex'
let g:tex_flavor='latex'
So, if you're having problems getting Vim-LaTeX to load when Vim opens a .tex file, try making that change (as well as all of the filetype plugin changes to your .vimrc that are documented).
Some alternative solutions:
- ALTERNATIVE 1: If you don't want to make that change, you can add
to the top of any .tex file that you want to force to load vim-latex. That is, Vim will still default to using the plaintex flavor unless it sees that comment or commands like \documentclass, \begin, or \usepackage.%&latex
- ALTERNATIVE 2: You can actually add
OR% vim: filetype=tex
to ANY file to force vim-latex to load. (note: you may need to have the modeline option turned on in Vim for this to work)% vim: ft=tex
- ALTERNATIVE 3: While editing ANY file, you can execute the Vim command (in command mode):
OR:set filetype=tex
to load vim-latex at that instant.:set ft=tex
