aboutsummaryrefslogtreecommitdiff
path: root/lua/pml68/plugins/guard.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua/pml68/plugins/guard.lua')
-rw-r--r--lua/pml68/plugins/guard.lua20
1 files changed, 20 insertions, 0 deletions
diff --git a/lua/pml68/plugins/guard.lua b/lua/pml68/plugins/guard.lua
new file mode 100644
index 0000000..9f033b3
--- /dev/null
+++ b/lua/pml68/plugins/guard.lua
@@ -0,0 +1,20 @@
+return {
+ "nvimdev/guard.nvim",
+ dependencies = {
+ "nvimdev/guard-collection"
+ },
+ event = { "BufReadPost", "BufNewFile" },
+ config = function()
+ local ft = require("guard.filetype")
+
+ ft("c,cpp,h"):fmt("clang-format")
+ ft("json"):fmt({
+ cmd = "jq",
+ stdin = true
+ })
+ vim.g.guard_config = {
+ fmt_on_save = true,
+ lsp_as_default_formatter = true
+ }
+ end
+}