chore(nvim): disable auto-formatting
This is tricky when working on projects that use different formatting and coding styles (e.g. Drupal and Symfony), and on projects that haven't had code formatting run on them before and making a small change causes a large number of changes to be staged. I'll experiment with formatting code within a range, or toggling auto-formatting per project. Maybe something similar to what @wincent showed in https://youtu.be/ifA8iw42vwI.
This commit is contained in:
parent
44e7add133
commit
776772a952
|
@ -19,16 +19,5 @@ null_ls.setup {
|
||||||
diagnostics.phpstan,
|
diagnostics.phpstan,
|
||||||
|
|
||||||
completion.spell,
|
completion.spell,
|
||||||
},
|
}
|
||||||
|
|
||||||
on_attach = function(client)
|
|
||||||
if client.resolved_capabilities.document_formatting then
|
|
||||||
vim.cmd [[
|
|
||||||
augroup LspFormatting
|
|
||||||
autocmd! * <buffer>
|
|
||||||
autocmd BufWritePre <buffer> lua vim.lsp.buf.formatting_sync()
|
|
||||||
augroup END
|
|
||||||
]]
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue