From c54d55bd47db65892c34851d2d3e08630efa00ff Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Thu, 13 Jan 2022 23:24:34 +0100 Subject: Add formatting on save --- lua/config/autocommands.lua | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lua') diff --git a/lua/config/autocommands.lua b/lua/config/autocommands.lua index 213801a..a6038d2 100644 --- a/lua/config/autocommands.lua +++ b/lua/config/autocommands.lua @@ -26,4 +26,9 @@ vim.cmd([[ autocmd! autocmd User AlphaReady set showtabline=0 | autocmd BufUnload set showtabline=2 augroup end + Autoformat + augroup _lsp + autocmd! + autocmd BufWritePre * lua vim.lsp.buf.formatting() + augroup end ]]) -- cgit v1.2.3-70-g09d2