autoformat
This commit is contained in:
@@ -15,6 +15,14 @@ require('mason-lspconfig').setup({
|
||||
ensure_installed = servers,
|
||||
})
|
||||
|
||||
-- auto format on save
|
||||
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||
buffer = vim.b.buffer,
|
||||
callback = function()
|
||||
vim.lsp.buf.format { async = false }
|
||||
end
|
||||
})
|
||||
|
||||
-- Set different settings for different languages' LSP
|
||||
-- LSP list: https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md
|
||||
-- How to use setup({}): https://github.com/neovim/nvim-lspconfig/wiki/Understanding-setup-%7B%7D
|
||||
|
||||
@@ -10,4 +10,3 @@ if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
||||
})
|
||||
end
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user