diff --git a/dotfiles/.config/nvim/lua/lsp.lua b/dotfiles/.config/nvim/lua/lsp.lua index 85f9e8f..a340218 100644 --- a/dotfiles/.config/nvim/lua/lsp.lua +++ b/dotfiles/.config/nvim/lua/lsp.lua @@ -1,3 +1,5 @@ +local autoformat_files = '*.py,*.rs,*.tf' + local common_on_attach = function(client, bufnr) -- Mappings. vim.keymap.set("n", "K", "lua vim.lsp.buf.hover()") @@ -12,7 +14,7 @@ local common_on_attach = function(client, bufnr) -- Autoformat on save. if client.supports_method("textDocument/formatting") then vim.api.nvim_create_autocmd("BufWritePre", { - pattern = '*.py,*.rs', + pattern = autoformat_files, callback = function() vim.lsp.buf.format() end, @@ -32,7 +34,6 @@ local capabilities = vim.lsp.protocol.make_client_capabilities() -- LSPs local servers = { "clangd", - "dartls", "gleam", "lua_ls", "ocamllsp",