# HG changeset patch # User zegervdv # Date 1664953018 -7200 # Node ID 6e98364a5a28bb0463a87fdfe77d7a8c3c63fb25 # Parent 6aabd0b8d766cfccd3f2324a2b82f90d7eaf86a2 chore: convert chezmoi autocmds to lua diff -r 6aabd0b8d766 -r 6e98364a5a28 .chezmoitemplates/config.vim --- a/.chezmoitemplates/config.vim Sun Oct 02 18:43:18 2022 +0200 +++ b/.chezmoitemplates/config.vim Wed Oct 05 08:56:58 2022 +0200 @@ -127,11 +127,3 @@ " " Vinegar/NetRW autocmd FileType netrw setl bufhidden=delete -" -augroup Chezmoi - autocmd! - autocmd BufWritePost ~/.local/share/chezmoi/* silent !chezmoi apply --source-path % - autocmd BufWritePost ~/.local/share/chezmoi/.chezmoitemplates/init.lua silent !chezmoi apply --source-path ~/.local/share/chezmoi/dot_config/nvim/init.lua.tmpl - autocmd BufWritePost ~/.local/share/chezmoi/.chezmoitemplates/config.vim silent !chezmoi apply --source-path ~/.local/share/chezmoi/dot_config/nvim/plugin/config.vim.tmpl - autocmd BufWritePost ~/.local/share/chezmoi/dot_config/nvim/init.lua source | PackerCompile -augroup END diff -r 6aabd0b8d766 -r 6e98364a5a28 .chezmoitemplates/init.lua --- a/.chezmoitemplates/init.lua Sun Oct 02 18:43:18 2022 +0200 +++ b/.chezmoitemplates/init.lua Wed Oct 05 08:56:58 2022 +0200 @@ -1007,6 +1007,16 @@ }, }) +-- Apply changes in chezmoi managed files +au.group('chezmoi', { + { 'BufWritePost', os.getenv 'HOME' .. '/.local/share/chezmoi/*', 'silent !chezmoi apply --source-path %' }, + { + 'BufWritePost', + os.getenv 'HOME' .. '/.local/share/chezmoi/.chezmoitemplates/init.lua', + 'silent !chezmoi apply --source-path $HOME/.local/share/chezmoi/dot_config/nvim/init.lua.tmpl', + }, +}) + -- Snippets local ls = require 'luasnip' -- Expand snippet or jump to next placeholder