From f1edd2aba00cbb728f95e02f38784daf54fe3e2f Mon Sep 17 00:00:00 2001 From: rootiest Date: Mon, 16 Sep 2024 09:46:38 -0400 Subject: [PATCH] feat: add LazyGit root detection on buffer enter --- lua/config/autocmds.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lua/config/autocmds.lua b/lua/config/autocmds.lua index 8350d37..5a8501b 100644 --- a/lua/config/autocmds.lua +++ b/lua/config/autocmds.lua @@ -54,6 +54,14 @@ autocmd({ "BufEnter", "FocusGained" }, { end, }) +-- LazyGit root detection +vim.api.nvim_create_autocmd("BufEnter", { + pattern = "*", + callback = function() + require("lazygit.utils").project_root_dir() + end, +}) + -- TodoFzfLua command override to use Telescope -- when fzf-lua is not installed autogrp("TodoFzfLua", { clear = true })