Browse Source

Fixed the auto-format on save

master
Julio Biason 2 years ago
parent
commit
acf9dabea3
  1. 2
      nvim/after/plugin/lsp.lua

2
nvim/after/plugin/lsp.lua

@ -18,7 +18,7 @@ local attachment = function(client, bufnr)
if client.resolved_capabilities.document_formatting then if client.resolved_capabilities.document_formatting then
vim.api.nvim_command [[augroup Format]] vim.api.nvim_command [[augroup Format]]
vim.api.nvim_command [[autocmd! * <buffer>]] vim.api.nvim_command [[autocmd! * <buffer>]]
vim.api.nvim_command [[autocmd BufWritePre <buffer> lua vim.lsp.buf.formatting_seq_sync()]] vim.api.nvim_command [[autocmd BufWritePre <buffer> lua vim.lsp.buf.format({async = false})]]
vim.api.nvim_command [[augroup END]] vim.api.nvim_command [[augroup END]]
end end
end end

Loading…
Cancel
Save