I want vim to automatically set the filetype to PKGBUILD when I am editing files that are named PKGBUILD.  How can I accomplish this?
How to set filetype to PKGBUILD when the filename is PKGBUILD?
filetype
You could define the following autocmd in your vimrc :    autocmd BufRead,BufNewFile PKGBUILD set filetype=PKGBUILDAnd to make sure the autocmd is not duplicated every time your vimrc is sourced, you could wrap it into an augroup and empty the latter at the beginning (autocmd!):augroup pkgbuild    autocmd!    autocmd BufRead,BufNewFile PKGBUILD set filetype=PKGBUILDaugroup ENDBufRead and BufNewFile are 2 possible events which will trigger, for a buffer whose name is PKGBUILD, the command: set filetype=PKGBUILDFor more information, see::help autocmd:help autocmd-events:help augroup