fix not using current file's path

This commit is contained in:
Lucario387 2022-08-15 19:41:39 +09:00 committed by Sidhanth Rathod
parent 14ef6759be
commit e0d3950f50

View File

@ -17,7 +17,7 @@ M.lazy_load = function(tb)
vim.defer_fn(function()
require("packer").loader(tb.plugin)
if tb.plugin == "nvim-lspconfig" then
vim.cmd "silent! do FileType"
vim.cmd("silent! do FileType")
end
end, 0)
else
@ -33,15 +33,15 @@ end
-- This gives an instant preview of nvim with the file opened
M.on_file_open = function(plugin_name)
M.lazy_load {
M.lazy_load({
events = { "BufRead", "BufWinEnter", "BufNewFile" },
augroup_name = "BeLazyOnFileOpen" .. plugin_name,
plugin = plugin_name,
condition = function()
local file = vim.fn.expand "%"
local file = vim.fn.expand("%")
return file ~= "NvimTree_1" and file ~= "[packer]" and file ~= ""
end,
}
})
end
M.packer_cmds = {
@ -79,10 +79,10 @@ M.mason_cmds = {
M.gitsigns = function()
autocmd({ "BufRead" }, {
callback = function()
vim.fn.system [[git rev-parse 2>/dev/null]]
vim.fn.system("git rev-parse 2>/dev/null " .. vim.fn.expand("%:p:h"))
if vim.v.shell_error == 0 then
vim.schedule(function()
require("packer").loader "gitsigns.nvim"
require("packer").loader("gitsigns.nvim")
end)
end
end,