From d8187ee775ce75b3b44bbb62552a65af2f3786bc Mon Sep 17 00:00:00 2001 From: Sanchayan Maity Date: Mon, 18 Nov 2024 11:01:48 +0530 Subject: [PATCH] nvim: after/ftplugin/json: Lint on save --- nvim/.config/nvim/after/ftplugin/json.lua | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/nvim/.config/nvim/after/ftplugin/json.lua b/nvim/.config/nvim/after/ftplugin/json.lua index 0993f3c..0b94301 100644 --- a/nvim/.config/nvim/after/ftplugin/json.lua +++ b/nvim/.config/nvim/after/ftplugin/json.lua @@ -1 +1,8 @@ vim.keymap.set('n', 'gq', ":%!jq '.'", { noremap=true, silent=true, buffer=0 }) + +vim.api.nvim_create_autocmd({ "BufWritePost" }, { + buffer = 0, + callback = function() + require("lint").try_lint() + end, +})