nvim: remove dart, move autoformat extensions to var
This commit is contained in:
parent
563995032c
commit
a3b0b8754b
1 changed files with 3 additions and 2 deletions
|
@ -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",
|
||||
|
|
Loading…
Reference in a new issue