aboutsummaryrefslogtreecommitdiff
path: root/lua/plugins.lua
diff options
context:
space:
mode:
authorjdhao <jdhao@hotmail.com>2021-08-07 02:32:12 +0800
committerjdhao <jdhao@hotmail.com>2021-08-07 02:32:12 +0800
commitd434627738c59473530d807cb645df6deb4c8e80 (patch)
treec6866fdfa0906ef5b8bf5243af0f6865e76e603c /lua/plugins.lua
parent0830dfcf90dc708330730808f2fd67f5b7f46ef3 (diff)
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
Diffstat (limited to 'lua/plugins.lua')
-rw-r--r--lua/plugins.lua10
1 files changed, 1 insertions, 9 deletions
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'}}