From 20a1476c088ce463e22ae96b655659d9cc9732b5 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Wed, 23 Aug 2023 17:00:12 +0000 Subject: [PATCH] make it better by using la --- config/nvim/lua/core/plugin_config/formatter.lua | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/config/nvim/lua/core/plugin_config/formatter.lua b/config/nvim/lua/core/plugin_config/formatter.lua index 6263faea..a97228a9 100644 --- a/config/nvim/lua/core/plugin_config/formatter.lua +++ b/config/nvim/lua/core/plugin_config/formatter.lua @@ -41,7 +41,8 @@ require("formatter").setup({ }, }) -vim.api.nvim_command("augroup FormatAutogroup") -vim.api.nvim_command("autocmd!") -vim.api.nvim_command("autocmd BufWritePost * FormatWrite") -vim.api.nvim_command("augroup END") +vim.api.nvim_create_autocmd({ "BufWritePost" }, { + callback = function() + vim.api.nvim_command("FormatWrite") + end, +})