How about this? Put this autocommand early in your vimrc, before
any filetype or syntax commands:
autocmd Filetype sh,raku let b:did_ftplugin = 1
Then put this autocommand late in your vimrc, after all filetype and
syntax commands:
autocmd Filetype sh,raku syn clear | unlet! b:current_syntax
I use the following system in my vimrc for controlling which
filetypes get syntax highlighting, but I think the above is
sufficient. (b:syn is used to track the desired state of 'syntax'.
Other autocommands use it to control syntax highlighting when 'diff'
is turned on and off.)
" ":syntax manual" will enable syntax highlighting only for specific
" buffers in which :set syntax=ON" is set. See ":help :syn-manual".
"
syntax manual
let no_syntax_filetypes = [ 'c', 'cpp', 'man', 'netrw', 'objcpp', 'python', 'vim' ]
autocmd FileType * if !empty(expand("<amatch>"))
\ | if !count(no_syntax_filetypes, expand("<amatch>"))
\ | let b:syn="ON"
\ | if !&diff
\ | setlocal syntax=ON
\ | endif
\ | else
\ | syn clear
\ | if exists("b:current_syntax")
\ | unlet b:current_syntax
\ | endif
\ | endif
\ | endif
Regards,
Gary