Thanks Chip. I have made my own filetype.vim and it works when I put it into my $HOME/.vim but my problem is that the plugin is in another place. Basically in my .vimrc the first lines is:
let $TDVIMROOT="/opt/TDVim" " Set runtime paths set runtimepath=$TDVIMROOT,$VIMRUNTIME In /opt/TDVim I copy the same filetype.vim used in my HOME and delete the one in $HOME/.vim. But now it doesn't work. So basically when using the filetype from /opt/TDVim, even with a correct runtimepath it doesn't work. I have also tried setting the runtime path as: set runtimepath=$VIMRUNTIME,$TDVIMROOT but is also not working. Any ideas??? thx 2009/10/26 Charles Campbell <[email protected]> > > Pablo Giménez wrote: > > Hi all. > > I am writinga global plugin that, among other things, will override > > some filetype settings. > > So basically I have my plugin in the runtime and I want to know what > > is the more ellegant/best wasy to: > > - Override some tipe detection. for instance Iwant that files with > > thesl extension will be threat as RenderMan shading language instead > > of slang. > > - Use my own settings for a file type, for example have my own > > settings for python. > > > > I prefer to have a file for fiel type detection and one file per file > > type settings. > > I have tested creating my own filetype.vim in my plugin folder but not > > yet working, however I am afraid to override complitelly the global > > filetype.vim because Iwant to override it only for some file types, > > and in case my file type is not detected then fallback to the global > > filetype.vim. > > Also if I have my own pytyhon.vim in the ftplugin folder of my plugin, > > it will override the global one???? > > Don't modify the global filetype.vim -- next time you upgrade, your > modification(s) will be overwritten. > > Modify/create $HOME/.vim/filetype.vim . An example of a typical entry: > > if exists("did_load_myfiletypes") > finish > endif > let did_load_myfiletypes= 1 > > augroup filetypedetect > > au BufNewFile,BufReadPost *.dif,*.diff,ptch setf diff > augroup END > > > Now, about $HOME/.vim/ftplugin/python.vim -- in the typical loading > sequence, it will be loaded before the global file(s) (see :echo &rtp > to get an idea of your loading sequence). So it *won't* override the > global one. If you want to override global plugins, may I suggest that > you put it in $HOME/.vim/after/ftplugin/python.vim instead. It will > then be loaded after global plugins and will have a chance to override. > > Regards, > Chip Campbell > > > > > -- Un saludo Best Regards Pablo Giménez --~--~---------~--~----~------------~-------~--~----~ You received this message from the "vim_use" maillist. For more information, visit http://www.vim.org/maillist.php -~----------~----~----~----~------~----~------~--~---
