The documentation says:
<afile> When executing autocommands, is replaced with the file name for a file read or write. <abuf> When executing autocommands, is replaced with the currently effective buffer number (for ":r file" and ":so file" it is the current buffer, the file being read/sourced is not in a buffer). <amatch> When executing autocommands, is replaced with the match for which this autocommand was executed. It differs from <afile> only when the file name isn't used to match with (for FileType, Syntax and SpellFileMissing events).
Yet, if I had this
autocmd BufNewFile * echo expand('<amatch>') expand('<afile>')
And opened, say
cd /tmp; vim .zshrc), I get:
They are not the same. What's going on?
% is faithful to what I actually typed.
vim ./.zshrc with
expand('%') added to the above
autocmd gives me:
/tmp/.zshrc .zshrc ./.zshrc