mirror of
https://github.com/jdhao/nvim-config.git
synced 2025-06-08 14:14:33 +02:00
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
This commit is contained in:
@@ -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'}}
|
||||
|
||||
Reference in New Issue
Block a user