46 |
46 |
47 vim.api.nvim_create_autocmd("BufWritePre", { |
47 vim.api.nvim_create_autocmd("BufWritePre", { |
48 group = vim.api.nvim_create_augroup("lsp_autoformat", { clear = true }), |
48 group = vim.api.nvim_create_augroup("lsp_autoformat", { clear = true }), |
49 callback = function(opts, bufnr) |
49 callback = function(opts, bufnr) |
50 if autoformat_filetypes[vim.bo.filetype] then |
50 if autoformat_filetypes[vim.bo.filetype] then |
51 vim.lsp.buf.formatting_seq_sync(nil, 100) |
51 vim.lsp.buf.format({ timeout_ms = 100 }) |
52 end |
52 end |
53 end, |
53 end, |
54 }) |
54 }) |
55 |
55 |
56 -- This can be removed when mason-lspconfig gets support for standardrb |
56 -- This can be removed when mason-lspconfig gets support for standardrb |