mirror of
https://github.com/nmasur/dotfiles
synced 2024-11-22 07:35:38 +00:00
fix: terraform highlights and formatting
This commit is contained in:
parent
e819c2a7b6
commit
f493b263e0
@ -83,8 +83,8 @@ require("packer").startup(function(use)
|
||||
extensions = {
|
||||
Brewfile = "brewfile",
|
||||
muttrc = "muttrc",
|
||||
tfvars = "hcl",
|
||||
tf = "hcl",
|
||||
tfvars = "terraform",
|
||||
tf = "terraform",
|
||||
},
|
||||
literal = {
|
||||
Caskfile = "brewfile",
|
||||
@ -175,6 +175,17 @@ require("packer").startup(function(use)
|
||||
-- require("null-ls").builtins.diagnostics.markdownlint,
|
||||
-- require("null-ls").builtins.diagnostics.pylint,
|
||||
},
|
||||
-- Format on save
|
||||
on_attach = function(client)
|
||||
if client.resolved_capabilities.document_formatting then
|
||||
vim.cmd([[
|
||||
augroup LspFormatting
|
||||
autocmd! * <buffer>
|
||||
autocmd BufWritePre <buffer> lua vim.lsp.buf.formatting_seq_sync()
|
||||
augroup END
|
||||
]])
|
||||
end
|
||||
end,
|
||||
})
|
||||
end,
|
||||
})
|
||||
@ -290,8 +301,6 @@ require("packer").startup(function(use)
|
||||
highlight = { enable = true },
|
||||
indent = { enable = true },
|
||||
})
|
||||
local parser_config = require("nvim-treesitter.parsers").get_parser_configs()
|
||||
parser_config.hcl.used_by = { "tf" }
|
||||
end,
|
||||
})
|
||||
|
||||
@ -461,14 +470,6 @@ vim.api.nvim_exec(
|
||||
false
|
||||
)
|
||||
|
||||
-- Formatting
|
||||
vim.api.nvim_exec(
|
||||
[[
|
||||
au BufWritePost * lua vim.lsp.buf.formatting()
|
||||
]],
|
||||
false
|
||||
)
|
||||
|
||||
-- LaTeX options
|
||||
vim.api.nvim_exec(
|
||||
[[
|
||||
|
Loading…
Reference in New Issue
Block a user