1
0
mirror of https://github.com/jdhao/nvim-config.git synced 2025-06-08 14:14:33 +02:00

Update load condition for vim-fugitive

See https://stackoverflow.com/a/38088814/6064933 for how to check if we
are inside a Git repository.
This commit is contained in:
jdhao 2021-07-29 23:11:30 +08:00
parent c8777db448
commit 3f0c6650f2

View File

@ -178,7 +178,15 @@ require('packer').startup(
-- use 'airblade/vim-gitgutter'
-- Git command inside vim
use {'tpope/vim-fugitive', cmd = {'Git', 'Gwrite'}}
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}
-- Better git log display
use {'rbong/vim-flog', require = 'tpope/vim-fugitive', cmd = {'Flog'}}