Remove global formatting configuration

Will be replaced with project specific configurations
This commit is contained in:
Sonny Bakker 2025-04-02 09:10:04 +02:00
parent 87f05c5d83
commit f21944eb52
3 changed files with 0 additions and 27 deletions

View file

@ -11,5 +11,4 @@ require('indent-blankline')
require('_nvim-tree')
require('lua-line')
require('_source-link')
require('formatting')
require('diagnostic')

View file

@ -1,24 +0,0 @@
-- {{ ansible_managed }}
local enable_formatting = vim.env.enable_formatting == 'true';
if (enable_formatting) then
vim.api.nvim_create_autocmd('LspAttach', {
group = vim.api.nvim_create_augroup('lsp', { clear = true }),
callback = function(args)
local client = vim.lsp.get_client_by_id(args.data.client_id)
if client.server_capabilities.documentFormattingProvider then
vim.api.nvim_create_autocmd('BufWritePre', {
buffer = args.buf,
callback = function()
vim.lsp.buf.format {
async = false,
id = args.data.client_id
}
end,
})
end
end
})
end

View file

@ -23,10 +23,8 @@ local on_attach = function(client, bufnr)
vim.keymap.set('n', ']d', vim.diagnostic.goto_next, opts)
vim.keymap.set('n', '<space>q', vim.diagnostic.setloclist, opts)
vim.keymap.set('n', '<space>la', vim.lsp.buf.code_action, opts)
end
--enable some language servers with the additional completion capabilities
--offered by nvim-cmp
local servers = {