On Fri, 18 Mar 2011, Tony Mechelynck wrote:
On 18/03/11 14:18, Bram Moolenaar wrote:Thilo Six wrote:i have patched filetype.vim again. As there are certain newly '.d/' directories that now can contain configurations. e.g. from man xorg.con(5) on my system:,----[ man xorg.con(5) ]--------------------- Xorg uses a configuration file called xorg.conf and files end‐ ing in the suffix .conf from the directory xorg.conf.d for its initial setup. `--------------------------------------------- I have tested those changes as good as i can and they worked for me.I would prefer to keep the direct file names, those are the ones that are mostly used. This applies to /etc/apt/sources.list and /etc/limits. For the last one you changed it to limits.conf.Recent openSUSE Linux distros (at least the 11.4 released on the 10th of this month) use the following:/etc/X11/xorg.conf.d/10-evdev.conf /etc/X11/xorg.conf.d/11-mouse.conf /etc/X11/xorg.conf.d/50-device.conf /etc/X11/xorg.conf.d/50-monitor.conf /etc/X11/xorg.conf.d/50-screen.conf /etc/X11/xorg.conf.d/50-synaptics.conf /etc/X11/xorg.conf.d/50-vmmouse.conf /etc/X11/xorg.conf.d/50-wacom.conf /etc/X11/xorg.conf.d/90-keytable.confOn 11.3, synaptics and wacom are prefixed by 20- instead of 50- ; I don't have an installed openSUSE 11.2 or earlier anymore.The monolithic /etc/X11/xorg.conf seems to be a thing of the past, at least on the distro I'm using.
Same on Gentoo.The '{program}.conf' or '{program}.d/*.conf' or '{program}.conf.d/*.conf' paradigm is pretty widespread.
My home Gentoo system has 84 such directories under /etc/. My work OpenSUSE 11.3 system has 75 of them. A Debian 6 VM (with very few non-default packages installed) has 64 of them. [Tested with: find /etc/ -name '*.d' -type d | wc -l]Perhaps it would be easier to simply fire off another autocmd to detect based on an altered name?
So, instead of hardcoding:
au BufNewFile,BufRead */xorg{,.conf.d/*}.conf{,-4} setf xf86conf
Go back to:
au BufNewFile,BufRead xorg.conf{,-4} setf xf86conf
but also have (not sure how to actually do this):
au BufNewFile,BufRead *{,.conf}.d/*.conf call
DetectFiletypeAgainst(substitute('\%(\.conf\)\=\.d/[^/]\+\.conf','.conf','',''))
" e.g. when called on '/etc/xorg.conf.d/10-foo.conf', would detect
" filetype against '/etc/xorg.conf'
" /etc/ConsoleKit/seats.d/00-primary.seat -> /etc/ConsoleKit/seats.seatDefinitely missing some corner-case stuff, but that seems more maintainable than the current way.
-- Best, Ben -- 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
