显示缓冲区与其相应文件之间差异的命令
是否有 emacs 命令可以显示缓冲区与其文件之间的差异?
例如,我对缓冲区进行了一些编辑,但忘记了它们是什么,现在我需要将缓冲区保存到其文件中,但想首先检查我实际更改的内容。
Is there an emacs command to show the difference between a buffer and its file?
For example, I've made some edits to a buffer, forgotten what they were, and now I need to save the buffer to its file, but want to check what I have actually changed first.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
带文件的差异缓冲区
。我刚刚在谷歌上搜索“emacs 比较缓冲区文件已更改”。diff-buffer-with-file
. I just googled for "emacs compare buffer file changed".另一种选择是按
Cx s
,然后按d
。这也显示了缓冲区与其文件之间的差异。如果感兴趣的缓冲区是唯一需要保存的缓冲区,则最有用。
Another option is to hit
C-x s
followed byd
. This also shows a diff between a buffer and its file.Most useful if the buffer of interest is the only one that needs saving.