mirror of
https://github.com/jdhao/nvim-config.git
synced 2025-06-08 14:14:33 +02:00
Compare commits
No commits in common. "e57e747b26b7e26e161c9c61c32ddf124e74ff44" and "78baf8d015695c2b795ac6f955550f5e96104845" have entirely different histories.
e57e747b26
...
78baf8d015
@ -42,8 +42,9 @@ api.nvim_create_augroup("packer_auto_compile", {
|
||||
api.nvim_create_autocmd({ "BufWritePost" }, {
|
||||
pattern = "*/nvim/lua/plugins.lua",
|
||||
group = "packer_auto_compile",
|
||||
callback = function(ctx)
|
||||
local cmd = "source " .. ctx.file
|
||||
callback = function()
|
||||
local fpath = fn.expand("<afile>")
|
||||
local cmd = "source " .. fpath
|
||||
vim.cmd(cmd)
|
||||
vim.cmd("PackerCompile")
|
||||
end
|
||||
@ -57,8 +58,10 @@ api.nvim_create_augroup("auto_create_dir", {
|
||||
api.nvim_create_autocmd({ "BufWritePre" }, {
|
||||
pattern = "*",
|
||||
group = "auto_create_dir",
|
||||
callback = function(ctx)
|
||||
local dir = fn.fnamemodify(ctx.file, ":p:h")
|
||||
callback = function()
|
||||
local fpath = fn.expand('<afile>')
|
||||
local dir = fn.fnamemodify(fpath, ":p:h")
|
||||
|
||||
utils.may_create_dir(dir)
|
||||
end
|
||||
})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user