From 1a7de720813bea5aa6235064bcd4a31106c626d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emmanuel=20BENO=C3=8ET?= Date: Sun, 18 Jun 2023 15:51:18 +0200 Subject: [PATCH] plugin - Prevent fugitive from killing vim-which-key --- plugins/vim-fugitive.cfg.vim | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/plugins/vim-fugitive.cfg.vim b/plugins/vim-fugitive.cfg.vim index 363996b..734b256 100644 --- a/plugins/vim-fugitive.cfg.vim +++ b/plugins/vim-fugitive.cfg.vim @@ -1 +1,16 @@ -autocmd FileType fugitive setlocal signcolumn=no nonumber norelativenumber notimeout +" Don't display useless columns in the Git status window +autocmd FileType fugitive setlocal signcolumn=no nonumber norelativenumber + +" Timeouts need to be disabled in the Git status window. We need to switch +" them off when entering it, and on when leaving it. +let s:in_fugitive_buffer = v:false +autocmd BufEnter * + \ if &ft ==# 'fugitive' + \ | set notimeout + \ | let s:in_fugitive_buffer = v:true + \ | endif +autocmd BufLeave * + \ if s:in_fugitive_buffer + \ | let s:in_fugitive_buffer = v:false + \ | set timeout + \ | endif