On 2010-05-04, Vitali Karasenko wrote: > Hello everyone, > > I use firefox with the imperator plugin, which allows me to write in vim when > I > am writing a forum post. Since I frequently use forums which support latex it > would be very useful if the latex-suite would startup when I am invoking gvim > from within vimperator. Unfortunately vimperator opens a .tmp file, changing > the filetype afterwards also isn't an option. The best way to solve this imo > is > to let latex-suite also start when I'm editing .tmp files, but i don't know > where to change that.
There are a number of ways to do this. If the temporary file has a uniquely identifiable name--perhaps it includes "vimperator" or part of the web site's URL--you can tell Vim that that name is a LaTeX file. If the name is too general for that, you might be able to identify the file from its contents as well as its name. How to do this is explained in Vim's help: :help 43.2 :help new-filetype You can look in $VIMRUNTIME/filetype.vim for examples of how Vim determines the file type from name and contents. $VIMRUNTIME/scripts.vim contains examples of how Vim determines the file type from contents alone. I use these techniques to determine when Vim is editing a file created by the ViewSourceWith Firefox add-on and which contains an e-mail message. ViewSourceWith creates temporary files whose names contain the web site's URL, so I have this rule in my ~/.vim/filetype.vim file: au! BufRead,BufNewFile webmail.spocom.com*.txt setfiletype mail HTH, Gary ------------------------------------------------------------------------------ _______________________________________________ Vim-latex-devel mailing list Vim-latex-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/vim-latex-devel