From d434627738c59473530d807cb645df6deb4c8e80 Mon Sep 17 00:00:00 2001 From: jdhao Date: Sat, 7 Aug 2021 02:32:12 +0800 Subject: Fix: the loading condition for fugitive is wrong We should load fugitive in the following two situations: + When we open nvim in a Git repository + When we are inside nvim and change the working directory to a Git reposity --- lua/plugins.lua | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'lua') diff --git a/lua/plugins.lua b/lua/plugins.lua index ccc01af..7daf987 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -178,15 +178,7 @@ require('packer').startup( -- use 'airblade/vim-gitgutter' -- Git command inside vim - use {'tpope/vim-fugitive', cond = - function() - local res = vim.fn.system('git rev-parse --is-inside-work-tree') - if string.find(res, 'true') then - return true - else - return false - end - end} + use {'tpope/vim-fugitive', event = 'User InGitRepo'} -- Better git log display use {'rbong/vim-flog', require = 'tpope/vim-fugitive', cmd = {'Flog'}} -- cgit v1.2.3