mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-06-22 00:49:03 +02:00
feat(lsp): added opts.autoformat
to be able to disable autoformat by default. Fixes #65
This commit is contained in:
parent
30b7215de8
commit
b278b062ec
2 changed files with 5 additions and 2 deletions
|
@ -19,6 +19,8 @@ return {
|
|||
virtual_text = { spacing = 4, prefix = "●" },
|
||||
severity_sort = true,
|
||||
},
|
||||
-- Automatically format on save
|
||||
autoformat = true,
|
||||
-- options for vim.lsp.buf.format
|
||||
-- `bufnr` and `filter` is handled by the LazyVim formatter,
|
||||
-- but can be also overriden when specified
|
||||
|
@ -64,6 +66,9 @@ return {
|
|||
require("lazyvim.util").deprecate("lspconfig.setup_server", "lspconfig.opts.setup[SERVER]")
|
||||
end
|
||||
|
||||
-- setup autoformat
|
||||
require("lazyvim.plugins.lsp.format").autoformat = opts.autoformat
|
||||
|
||||
-- setup formatting and keymaps
|
||||
require("lazyvim.util").on_attach(function(client, buffer)
|
||||
require("lazyvim.plugins.lsp.format").on_attach(client, buffer)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue