Search code examples
vimneovim

Vim: How to declare that a file with a certain name should be of some file type?


I have a file named ini which receives no syntax highlighting since there is no file extension to help identify the file type. How would I go about declaring that all files which are named ini should be of type dosini?

No file type enter image description here


Solution

  • :h ftdetect may help you. Basically it is

    autocmd BufNewFile,BufRead *.ini setfiletype dosini