Buffer local auto commands only seem to work when the file is passed on the command line and not when opening a file in an existing session.
Similar behaviour is exhibited with buffer local map settings as well.
Tested in both vim 8.2.2029 and neovim 6 with the same result.
It's most likely that I'm mis-understanding something but here is what I expect.
- Create init.vim with only the following:
au BufWritePost <buffer> echo "Hello World" - Run
vim -u init.vim :e a.txt:w
Hello World printed in the status line
Nothing printed.
However if I run vim -u init.vim a.txt then it works as expected.