关闭文件而不退出 VIM 应用程序? [英] Close file without quitting VIM application?

查看:30
本文介绍了关闭文件而不退出 VIM 应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 :e:w 命令来编辑和写入文件.我不确定是否有关闭"命令可以在不离开 Vim 的情况下关闭当前文件?

I use the :e and :w commands to edit and to write a file. I am not sure if there is "close" command to close the current file without leaving Vim?

我知道:q 命令可以用来关闭一个文件,但是如果它是最后一个文件,Vim 也会被关闭;实际上在 Mac OS 上 MacVim 确实退出了.只有 Vim 窗口关闭,我可以使用 Control-N 再次打开一个空白的 Vim 窗口.我希望 Vim 在空白屏幕上保持打开状态.

I know that the :q command can be used to close a file, but if it is the last file, Vim is closed as well; Actually on Mac OS MacVim does quit. Only the Vim window is closed and I could use Control-N to open a blank Vim window again. I would like Vim to remain open with a blank screen.

推荐答案

这会删除缓冲区(转换为关闭文件)

This deletes the buffer (which translates to close the file)

:bd 

这篇关于关闭文件而不退出 VIM 应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆