Browse Source

feat: Moved autoreloader into optional `doom_reloader` module.

my-config
connorgmeean 3 years ago
parent
commit
96ef90aaa0
  1. 9
      lua/doom/modules/core/core/init.lua
  2. 26
      lua/doom/modules/features/doom_reloader/init.lua

9
lua/doom/modules/core/core/init.lua

@ -320,14 +320,7 @@ end
required.autocommands = function ()
local is_plugin_disabled = require("doom.utils").is_plugin_disabled
local autocmds = {
{ "BufWritePost", "*/doom/**/*.lua", function() require("doom.utils.reloader").full_reload() end },
{
"BufWritePost",
"*/doom-nvim/modules.lua,*/doom-nvim/config.lua",
function() require("doom.utils.reloader").full_reload() end,
},
}
local autocmds = {}
if doom.autosave then
table.insert(autocmds, { "TextChanged,InsertLeave", "<buffer>", "silent! write" })

26
lua/doom/modules/features/doom_reloader/init.lua

@ -0,0 +1,26 @@
local doom_reloader = {}
doom_reloader.settings = {
enabled = true,
languages = {
lua = {
template = {
annotation_convention = "ldoc",
},
},
},
}
doom_reloader.packages = {}
doom_reloader.configure_functions = {}
doom_reloader.autocommands = {
{ "BufWritePost", "*/doom/**/*.lua", function() require("doom.utils.reloader").full_reload() end },
{
"BufWritePost",
"*/doom-nvim/modules.lua,*/doom-nvim/config.lua",
function() require("doom.utils.reloader").full_reload() end,
},
}
return doom_reloader
Loading…
Cancel
Save