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

后端 未结 15 1897
日久生厌
日久生厌 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

    Method 1:

    • open a compare by:

    :windo diffthis

    • close it by:

    :windo diffoff

    Method 2:

    I recommend just using the most simple command: :q

    when you want to do it quickly, add the mapping:

    " Set mapleader
    let mapleader = ","
    let g:mapleader = ","
    

    and

    " Quickly close the current window
    nnoremap q :q
    

    It works well for me. Exit vimdiff just by ,q, because normally your cursor in the old file.

提交回复
热议问题