Hi,

the current filetype.vim does not detect the filetype for the dbus
configuration files (which on my system are stored in /etc/dbus-1/*
and subfolders). These are in doctype sgml and are not detected
because they end on ".conf". A simple patch is attached.

I think it would be best if vim could find out about filetypes without
having to resort to file endings as much as now. This would settle
cases as the one above once and for all.
Just as a naive idea: Couldn't the "file" program (or just its rules)
be used by vim? At least in this case it immediately returns the
correct file type and the magic rules there are already quite
sophisticated.

Best,
Sebastian Novak




-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
--- /usr/share/vim/vim72/filetype.vim	2010-05-15 00:34:09.000000000 +0200
+++ filetype.vim	2010-05-16 00:22:40.454133521 +0200
@@ -1674,6 +1674,12 @@
 	\   setf sgml |
 	\ endif
 
+" DBUS configuration file (in sgml)
+au BufNewFile,BufRead *.conf
+	\ if match(getline(1, min([line("$"), 50])), '<!DOCTYPE busconfig') > -1 |
+	\   setf sgml |
+	\ endif
+
 " SGMLDECL
 au BufNewFile,BufRead *.decl,*.dcl,*.dec
 	\ if getline(1).getline(2).getline(3) =~? '^<!SGML' |



Raspunde prin e-mail lui