summaryrefslogtreecommitdiff
path: root/lua/plugins
diff options
context:
space:
mode:
authorBenjamin Chausse <benjamin@chausse.xyz>2024-05-23 18:59:24 -0400
committerBenjamin Chausse <benjamin@chausse.xyz>2024-05-23 18:59:24 -0400
commit04042907c77f9790f78df0b6af52dbdd6e89ca55 (patch)
tree9eab24f715c828492602807032437daa893dd264 /lua/plugins
parentec5b7931bee6432dd30ad943518f603af53a15e0 (diff)
Better auto-cd into git root -> consistent harpoon
Diffstat (limited to 'lua/plugins')
-rw-r--r--lua/plugins/fugitive.lua13
1 files changed, 13 insertions, 0 deletions
diff --git a/lua/plugins/fugitive.lua b/lua/plugins/fugitive.lua
index 12a6385..ce5e173 100644
--- a/lua/plugins/fugitive.lua
+++ b/lua/plugins/fugitive.lua
@@ -1,6 +1,19 @@
return {
+ lazy = false,
"tpope/vim-fugitive",
dependencies = "tpope/vim-rhubarb",
+ config = function()
+
+ local handle = io.popen('git rev-parse --is-inside-work-tree 2> /dev/null')
+ if handle then
+ local result = handle:read('*a')
+ handle:close()
+ if result and result:match('true') then
+ vim.cmd([[Gcd]])
+ end
+ end
+
+ end,
-- Only load when using one of the following commands:
keys = {
{ "<leader>gs", "<cmd>G<CR>" }, -- G.it S.tatus