summaryrefslogtreecommitdiff
path: root/.config/nvim/lua
diff options
context:
space:
mode:
authoradam <56338480+adastx@users.noreply.github.com>2022-10-09 23:45:18 +0200
committeradam <56338480+adastx@users.noreply.github.com>2022-10-09 23:45:18 +0200
commita514903307a35963ede428b565ea499861839ef1 (patch)
tree3bf9ed0b4c26c8f91b24617cd40a36c16a865821 /.config/nvim/lua
parent19a80063e858fdfbafbce24f8e9ea3be044b73f0 (diff)
nvim: fugitive better git repo detection
Diffstat (limited to '.config/nvim/lua')
-rw-r--r--.config/nvim/lua/plugins.lua4
-rw-r--r--.config/nvim/lua/setup/fugitive.lua6
2 files changed, 9 insertions, 1 deletions
diff --git a/.config/nvim/lua/plugins.lua b/.config/nvim/lua/plugins.lua
index cf27f1f..68a0ee1 100644
--- a/.config/nvim/lua/plugins.lua
+++ b/.config/nvim/lua/plugins.lua
@@ -137,8 +137,10 @@ return require('packer').startup(function(use)
use {
"tpope/vim-fugitive",
- config = "vim.cmd [[call FugitiveDetect('~/.cfg')]]",
cmd = { 'G', 'Ggrep' },
+ config = function()
+ require "setup.fugitive"
+ end,
}
use {
diff --git a/.config/nvim/lua/setup/fugitive.lua b/.config/nvim/lua/setup/fugitive.lua
new file mode 100644
index 0000000..b48b4a9
--- /dev/null
+++ b/.config/nvim/lua/setup/fugitive.lua
@@ -0,0 +1,6 @@
+vim.cmd([[
+silent !in-git-repo
+if v:shell_error
+ call FugitiveDetect('~/.cfg')
+endif
+]])