自从在vim中打开缓冲区以来,撤消所有更改 [英] Undo all changes since opening buffer in vim

查看:47
本文介绍了自从在vim中打开缓冲区以来,撤消所有更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

自打开缓冲区以来,如何撤消所有更改?我想可能会有某种形式的:earlier 做到这一点.

How can I undo all changes since opening a buffer? I imagine there may be some form of :earlier that does this.

更新:许多人都提出了遍历到较早文件写入的建议解决方案.这不是我要的.我希望恢复到最初将文件加载到缓冲区时的文件原始状态,无论从那以后进行了多少次写操作.

UPDATE: Many are suggesting solutions for traversing to earlier file writes. This isn't what I asked for. I want to return to the original state the file was in when I originally loaded it into a buffer, no matter how many writes were made since then.

推荐答案

在vim 8.1及更高版本以及 neovim 中,您只需使用:u0

In vim 8.1+ as well as in neovim, you can just use :u0

这篇关于自从在vim中打开缓冲区以来,撤消所有更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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