Andrea Spadaccini wrote:
I am using tablatex.vim, ftplugin for LaTeX files, and I have a main
latex file and several included .tex files.
Well, vim loads the plugin (and the syntax file) when I'm editing the
main file, while it doesn't when I'm editing the included files.
How can I tell vim that I'm editing a .tex file? And how do I make vim
recognize .tex files without me setting the filetype?
Vim recognizes file types using two files: (assuming 7.0)
vim70/filetype.vim
vim70/scripts.vim
The "filetype.vim" file recognizes filetypes based on the files'
extension (ie. .c is a C file, .lsp is a Lisp file, etc).
The "scripts.vim" file recognizes filetypes based on the files' contents
(ie. the first line is /bin/ksh, so its a shell file, etc).
If you wish to customize this process to recognize personal extensions
as some filetype or to recognize file contents as indicating some
filetype, make a personal (wherever)/.vim/filetype.vim -or-
(wherever)/.vim/scripts.vim with appropriate recognition code. Look at
the vim70 versions for ideas about how to accomplish this. Caveat:
*don't* change the distributed vim70/filetype.vim or
vim70/scripts.vim. If you do, your emendations will no longer be
working and you'll make yourself a lot of irritating work trying to find
out why.
Regards,
Chip Campbell