Bugzilla – Bug 113647
wrong filetype detection in vim for /boot/grub/menu.lst
Last modified: 2006-11-18 23:18:31 UTC
vi /boot/grub/menu.lst opens the file with the wrong syntax highlighting. vim uses "asm", but "grub" would be correct. Workaround is ":set ft=grub" - but this is not known to average users.
On latest beta, this works just fine for me. filetype is set to grub as it should.
Finally found it: it works well for /boot/grub/menu.lst, but not for /testroot/boot/grub/menu.lst (/testroot is a partition I just prepared for betatesting 10.2) I also now know the reason why the /testroot/boot/grub/menu.lst is not detected as filetype=grub: # grep grub /usr/share/vim/current/filetype.vim au BufNewFile,BufRead /boot/grub/menu.lst,/boot/grub/grub.conf setf grub To reproduce: copy menu.lst to another directory and/or rename it.
Fixed in stable.
# grep grub filetype.vim au BufNewFile,BufRead */boot/grub/menu.lst,*/boot/grub/grub.conf,*/etc/grub.conf setf grub OK, this fixes the problem for grub configurations in "foreign" system partitions. Therefore it works in the "main corner case" :-) The cases "rename the file" or "copy it to another directory" are not covered, but those cases are really rare. (Detection based on file content would be perfect, but I'm not sure if it's worth the work.)