aboutsummaryrefslogtreecommitdiff
path: root/plugin/40-guard.lua
diff options
context:
space:
mode:
Diffstat (limited to 'plugin/40-guard.lua')
-rw-r--r--plugin/40-guard.lua14
1 files changed, 14 insertions, 0 deletions
diff --git a/plugin/40-guard.lua b/plugin/40-guard.lua
new file mode 100644
index 0000000..ffdd82a
--- /dev/null
+++ b/plugin/40-guard.lua
@@ -0,0 +1,14 @@
+vim.api.nvim_create_autocmd({ "BufEnter" }, {
+ once = true,
+ pattern = { "*.c", "*.cpp", "*.cc", "*.h", "*.hpp", "*.toml", "*.json", "*.lua" },
+ callback = function()
+ vim.pack.add({ "https://github.com/nvimdev/guard-collection" })
+ vim.pack.add({ "https://github.com/nvimdev/guard.nvim" })
+
+ local ft = require("guard.filetype")
+
+ ft("c,cpp,h"):fmt("clang-format")
+ ft("toml"):fmt("taplo")
+ ft("json"):fmt("jq")
+ end,
+})