fix not using current file's path
This commit is contained in:
parent
14ef6759be
commit
e0d3950f50
@ -17,7 +17,7 @@ M.lazy_load = function(tb)
|
|||||||
vim.defer_fn(function()
|
vim.defer_fn(function()
|
||||||
require("packer").loader(tb.plugin)
|
require("packer").loader(tb.plugin)
|
||||||
if tb.plugin == "nvim-lspconfig" then
|
if tb.plugin == "nvim-lspconfig" then
|
||||||
vim.cmd "silent! do FileType"
|
vim.cmd("silent! do FileType")
|
||||||
end
|
end
|
||||||
end, 0)
|
end, 0)
|
||||||
else
|
else
|
||||||
@ -33,15 +33,15 @@ end
|
|||||||
-- This gives an instant preview of nvim with the file opened
|
-- This gives an instant preview of nvim with the file opened
|
||||||
|
|
||||||
M.on_file_open = function(plugin_name)
|
M.on_file_open = function(plugin_name)
|
||||||
M.lazy_load {
|
M.lazy_load({
|
||||||
events = { "BufRead", "BufWinEnter", "BufNewFile" },
|
events = { "BufRead", "BufWinEnter", "BufNewFile" },
|
||||||
augroup_name = "BeLazyOnFileOpen" .. plugin_name,
|
augroup_name = "BeLazyOnFileOpen" .. plugin_name,
|
||||||
plugin = plugin_name,
|
plugin = plugin_name,
|
||||||
condition = function()
|
condition = function()
|
||||||
local file = vim.fn.expand "%"
|
local file = vim.fn.expand("%")
|
||||||
return file ~= "NvimTree_1" and file ~= "[packer]" and file ~= ""
|
return file ~= "NvimTree_1" and file ~= "[packer]" and file ~= ""
|
||||||
end,
|
end,
|
||||||
}
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
M.packer_cmds = {
|
M.packer_cmds = {
|
||||||
@ -79,10 +79,10 @@ M.mason_cmds = {
|
|||||||
M.gitsigns = function()
|
M.gitsigns = function()
|
||||||
autocmd({ "BufRead" }, {
|
autocmd({ "BufRead" }, {
|
||||||
callback = function()
|
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
|
if vim.v.shell_error == 0 then
|
||||||
vim.schedule(function()
|
vim.schedule(function()
|
||||||
require("packer").loader "gitsigns.nvim"
|
require("packer").loader("gitsigns.nvim")
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
Loading…
Reference in New Issue
Block a user