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" }, {
|
api.nvim_create_autocmd({ "BufWritePost" }, {
|
||||||
pattern = "*/nvim/lua/plugins.lua",
|
pattern = "*/nvim/lua/plugins.lua",
|
||||||
group = "packer_auto_compile",
|
group = "packer_auto_compile",
|
||||||
callback = function(ctx)
|
callback = function()
|
||||||
local cmd = "source " .. ctx.file
|
local fpath = fn.expand("<afile>")
|
||||||
|
local cmd = "source " .. fpath
|
||||||
vim.cmd(cmd)
|
vim.cmd(cmd)
|
||||||
vim.cmd("PackerCompile")
|
vim.cmd("PackerCompile")
|
||||||
end
|
end
|
||||||
@ -57,8 +58,10 @@ api.nvim_create_augroup("auto_create_dir", {
|
|||||||
api.nvim_create_autocmd({ "BufWritePre" }, {
|
api.nvim_create_autocmd({ "BufWritePre" }, {
|
||||||
pattern = "*",
|
pattern = "*",
|
||||||
group = "auto_create_dir",
|
group = "auto_create_dir",
|
||||||
callback = function(ctx)
|
callback = function()
|
||||||
local dir = fn.fnamemodify(ctx.file, ":p:h")
|
local fpath = fn.expand('<afile>')
|
||||||
|
local dir = fn.fnamemodify(fpath, ":p:h")
|
||||||
|
|
||||||
utils.may_create_dir(dir)
|
utils.may_create_dir(dir)
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user