Search code examples
windowsvimdriverinfftplugin

looking for a vim windows .inf ftplugin file


the ftplugin for vim *.inf files defaults to inform which says something about a Z-machine. Needless to say, this provides the wrong syntax highlighting etc for a windows .inf device driver file.

  • does anyone know of a vim syntax highlight file for windows .inf (device driver) files?
  • what about autoloading this file when appropriate (versus the z-machine inform file...)

Solution

  • The format of the Windows driver information files is (similar to) that of *.ini files, and Vim has a syntax script for that.

    :setf dosini
    

    To change the automatic detection, put the following into a ~/.vim/filetype.vim script:

    if exists('did_load_filetypes')
        finish
    endif
    augroup filetypedetect
    autocmd BufNewFile,BufRead *.inf    setf dosini
    augroup END