sourceURL:http://vim.1045645.n5.nabble.com/Change-filetype-sl-to-renderman-shader-language-instead-of-slang-td1886097.html
On 2010-07-23, AMDx64BT wrote: > Vim detects the extension .sl as slang filetype. I want that vim > detects the extension .sl as renderman shader lang filetype by > default and not as slang filetype. > > I have add to my .vimrc: > au BufRead,BufNewFile *.sl setf sl > > But it doesn't work. Do you know any solution? One solution would be to put the following line in a file in your ~/.vim/ftdetect directory (which you may have to create): au BufRead,BufNewFile *.sl set ft=sl The name of the file doesn't matter as long as the suffix is .vim. Note that that line is the same as yours except that I used "set ft=sl" instead of "setf sl". It might also work to put that line in your .vimrc, but I think you'll have less chance of problems if you follow the recommendations in the user manual. See :help :setf :help new-filetype " especially section A. Regards, Gary