How do you exit vimdiff mode in vim, specifically, for Fugitive?

后端 未结 15 1877
日久生厌
日久生厌 2021-01-30 05:01

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?

I.e.,

15条回答
  •  说谎
    说谎 (楼主)
    2021-01-30 05:42

    Check the vimdiff toggling between diffthis and diffoff here at this page.

    The code:

    nnoremap  df :call DiffToggle()
    
    function! DiffToggle()
        if &diff
            diffoff
        else
            diffthis
        endif
    :endfunction
    

提交回复
热议问题