autoformat

This commit is contained in:
2024-09-30 06:12:57 +02:00
parent 2bed3cbe6e
commit b9b77abfa4
8 changed files with 116 additions and 109 deletions

View File

@@ -15,6 +15,14 @@ require('mason-lspconfig').setup({
ensure_installed = servers, 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 -- Set different settings for different languages' LSP
-- LSP list: https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md -- 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 -- How to use setup({}): https://github.com/neovim/nvim-lspconfig/wiki/Understanding-setup-%7B%7D

View File

@@ -10,4 +10,3 @@ if not (vim.uv or vim.loop).fs_stat(lazypath) then
}) })
end end
vim.opt.rtp:prepend(lazypath) vim.opt.rtp:prepend(lazypath)