enable gitsigns when opening nvim from a none git repository

This commit is contained in:
Uy Ha 2022-11-02 09:00:33 +00:00 committed by Sidhanth Rathod
parent 0611d5c528
commit d3fe3fcc1a

View File

@ -65,7 +65,7 @@ M.gitsigns = function()
autocmd({ "BufRead" }, { autocmd({ "BufRead" }, {
group = vim.api.nvim_create_augroup("GitSignsLazyLoad", { clear = true }), group = vim.api.nvim_create_augroup("GitSignsLazyLoad", { clear = true }),
callback = function() callback = function()
vim.fn.system("git rev-parse " .. vim.fn.expand "%:p:h") vim.fn.system("git -C " .. vim.fn.expand "%:p:h" .. " status")
if vim.v.shell_error == 0 then if vim.v.shell_error == 0 then
vim.api.nvim_del_augroup_by_name "GitSignsLazyLoad" vim.api.nvim_del_augroup_by_name "GitSignsLazyLoad"
vim.schedule(function() vim.schedule(function()