1
0
Fork 0

nvim: use absolute path in config-autosource-autocmd

This commit is contained in:
tastytea 2022-08-15 20:59:18 +02:00
parent 27dedd8400
commit 59e7a364cd
Signed by: tastytea
SSH Key Fingerprint: SHA256:FBkvrOlhq5use1XEttyUGT4bUTDVA1ar9SgIc9P03cM
2 changed files with 5 additions and 2 deletions

View File

@ -24,7 +24,10 @@ vim.api.nvim_create_autocmd(
{ 'BufWritePost' },
{
group = 'config_init',
pattern = { '*/nvim/lua/my/*.lua', '*/nvim/init.lua' },
pattern = {
vim.fn.stdpath('config') .. '/lua/my/*.lua',
vim.fn.stdpath('config') .. '/init.lua'
},
callback = function()
-- exclude plugins.lua, because it is sourced in another autocmd
if not vim.api.nvim_buf_get_name(0):match('plugins.lua$') then

View File

@ -120,7 +120,7 @@ vim.api.nvim_create_autocmd(
{ 'BufWritePost' },
{
group = 'config_plugins',
pattern = { '*/nvim/lua/my/plugins.lua' },
pattern = { vim.fn.stdpath('config') .. '/lua/my/plugins.lua' },
command =[[source <afile> | PackerInstall]]
}
)