This autocommand only seems to be possible in vimscript. This may need further experimentation
It's enough to do what I want so I'm happy.
progress is being made hopefully this will become workable soon