1 Test for BufWritePre autocommand that deletes or unloads the buffer.
5 :au BufWritePre Xxx1 bunload
6 :au BufWritePre Xxx2 bwipe
8 A1
\e:.,/end of/w! Xxx1 " write test file Xxx1
9 $r2:.,/end of/w! Xxx2 " write test file Xxx2
11 :bdel test8.in " delete this file from the buffer list
13 :w " write it, will unload it and give an error msg
14 :w! test.out " Write contents of this file
15 :e! Xxx2 " start editing Xxx2
16 :bwipe test.out " remove test.out from the buffer list
17 :w " write it, will delete the buffer and give an error msg
18 :w >>test.out " Append contents of this file