From a3b0b8754ba9631dd65e5c82a18f09849c9c6ea3 Mon Sep 17 00:00:00 2001 From: Vladan Popovic Date: Mon, 14 Oct 2024 09:59:14 +0200 Subject: [PATCH] nvim: remove dart, move autoformat extensions to var --- dotfiles/.config/nvim/lua/lsp.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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",