test8.in

来自「VIM文本编辑器」· IN 代码 · 共 26 行

IN
26
字号
Test for BufWritePre autocommand that deletes or unloads the buffer.

STARTTEST
:au BufWritePre Xxx1 bunload
:au BufWritePre Xxx2 bdel
/start of
A1:.,/end of/w! Xxx1  " write test file Xxx1
$r2:.,/end of/w! Xxx2   " write test file Xxx2
:e! Xxx1                " start editing Xxx1
:w                      " write it, will unload it and give an error msg
:w! test.out            " Write contents of this file
:e! Xxx2                " start editing Xxx2
:bdel test.out          " remove test.out from the buffer list
:w                      " write it, will delete the buffer and give an error msg
:w >>test.out           " Append contents of this file
:!rm Xxx1 Xxx2
:qa!
ENDTEST

start of test file Xxx
	this is a test
	this is a test
	this is a test
	this is a test
end of test file Xxx

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?