Formatting on save is a popular workflow and is builtin to many text editors and IDEs. In Neovim, you must create this manually, but it is very easy using autocmds. -- 1 vim.api.nvim_create_autocmd("LspAttach", { group = vim.api.nvim_create_augroup("lsp", { clear = true }), callback = function(args) -- 2 vim.api.nvim_create_autocmd("BufWritePre", { -- 3 buffer = args.buf, callback = function() -- 4 + 5 vim.lsp.buf.format {async = false, id = args.data.client_id } end, }) end }) We create a ne...