nvim: remove dart, move autoformat extensions to var

This commit is contained in:
Vladan Popovic 2024-10-14 09:59:14 +02:00
parent 563995032c
commit a3b0b8754b

View file

@ -1,3 +1,5 @@
local autoformat_files = '*.py,*.rs,*.tf'
local common_on_attach = function(client, bufnr)
-- Mappings.
vim.keymap.set("n", "K", "<Cmd>lua vim.lsp.buf.hover()<CR>")
@ -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",