From 776772a952a7ae97485d6040702411251d418fa3 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Thu, 20 Jan 2022 18:00:00 +0000 Subject: [PATCH] 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. --- roles/neovim/files/lua/opdavies/lsp/null-ls.lua | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/roles/neovim/files/lua/opdavies/lsp/null-ls.lua b/roles/neovim/files/lua/opdavies/lsp/null-ls.lua index 28fecf8b..9f7e59e2 100644 --- a/roles/neovim/files/lua/opdavies/lsp/null-ls.lua +++ b/roles/neovim/files/lua/opdavies/lsp/null-ls.lua @@ -19,16 +19,5 @@ null_ls.setup { diagnostics.phpstan, completion.spell, - }, - - on_attach = function(client) - if client.resolved_capabilities.document_formatting then - vim.cmd [[ - augroup LspFormatting - autocmd! * - autocmd BufWritePre lua vim.lsp.buf.formatting_sync() - augroup END - ]] - end - end, + } }