如何在vim中(特别是对于逃亡者)退出vimdiff模式? [英] How do you exit vimdiff mode in vim, specifically, for Fugitive?

查看:352
本文介绍了如何在vim中(特别是对于逃亡者)退出vimdiff模式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用带有虚构扩展名的vim.它具有:Gdiff命令,可将您带入vimdiff模式,但是关闭/退出vimdiff模式的正确/快速方法是什么?

I am using vim with the fugitive extension. It has a :Gdiff command which brings you into vimdiff mode, but what is the right/quick way to close/quit vimdiff mode?

也就是说,假设我正在编辑Git存储库下的文件FooBar.txt.我启动了:Gdiff,查看我在vimdiff中所做的更改,然后我想返回并继续编辑FooBar.txt或任何其他文件:)

I.e., let's say I am editing the file FooBar.txt under Git repository. I fire up :Gdiff, review my changes in vimdiff, and then I want to get back and continue editing FooBar.txt or any other file :)

UPDATE1::我将在下一个工作日尝试这些快速组合:)

UPDATE1: I'm going to give these quick combos a try next working day :)

"vimdiff current vs git head (fugitive extension)
nnoremap <Leader>gd :Gdiff<cr> 
"switch back to current file and closes fugitive buffer
nnoremap <Leader>gD :diffoff!<cr><c-w>h:bd<cr>

UPDATE2:我当前的映射(仅关闭差异窗口!)

UPDATE2: My current mappings (closes diff window only!)

"vimdiff current vs git head (fugitive extension)
nnoremap <Leader>gd :Gdiff<cr> 
"switch back to current file and closes fugitive buffer
nnoremap <Leader>gD <c-w>h<c-w>c

此外,请帮助我确定以下内容是否应作答: https://stackoverflow.com/a/15975201/275980

Also, please help me decide if the following should be an anwser: https://stackoverflow.com/a/15975201/275980

推荐答案

您可以执行windo set nodiff noscrollbind,然后关闭第二个窗口.

You can execute windo set nodiff noscrollbind and then close the second window.

更新:有一个diffoff命令.使用windo diffoff,而不是我在上一行中写的内容.

Update: there is a diffoff command. Use windo diffoff, not what I wrote in previous line.

这篇关于如何在vim中(特别是对于逃亡者)退出vimdiff模式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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