最佳答案:先按ESC进入Command模式,然后输入“:wq”,回车就可以保存并退出了。vi的其他保存/退出命令::w 保存;:w filename 另存为filename;:wq! 保存并强制退出;:wq!