mirror of
https://github.com/nmasur/dotfiles
synced 2024-11-22 13:25: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 = {
|
extensions = {
|
||||||
Brewfile = "brewfile",
|
Brewfile = "brewfile",
|
||||||
muttrc = "muttrc",
|
muttrc = "muttrc",
|
||||||
tfvars = "hcl",
|
tfvars = "terraform",
|
||||||
tf = "hcl",
|
tf = "terraform",
|
||||||
},
|
},
|
||||||
literal = {
|
literal = {
|
||||||
Caskfile = "brewfile",
|
Caskfile = "brewfile",
|
||||||
@ -175,6 +175,17 @@ require("packer").startup(function(use)
|
|||||||
-- require("null-ls").builtins.diagnostics.markdownlint,
|
-- require("null-ls").builtins.diagnostics.markdownlint,
|
||||||
-- require("null-ls").builtins.diagnostics.pylint,
|
-- 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,
|
end,
|
||||||
})
|
})
|
||||||
@ -290,8 +301,6 @@ require("packer").startup(function(use)
|
|||||||
highlight = { enable = true },
|
highlight = { enable = true },
|
||||||
indent = { enable = true },
|
indent = { enable = true },
|
||||||
})
|
})
|
||||||
local parser_config = require("nvim-treesitter.parsers").get_parser_configs()
|
|
||||||
parser_config.hcl.used_by = { "tf" }
|
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -461,14 +470,6 @@ vim.api.nvim_exec(
|
|||||||
false
|
false
|
||||||
)
|
)
|
||||||
|
|
||||||
-- Formatting
|
|
||||||
vim.api.nvim_exec(
|
|
||||||
[[
|
|
||||||
au BufWritePost * lua vim.lsp.buf.formatting()
|
|
||||||
]],
|
|
||||||
false
|
|
||||||
)
|
|
||||||
|
|
||||||
-- LaTeX options
|
-- LaTeX options
|
||||||
vim.api.nvim_exec(
|
vim.api.nvim_exec(
|
||||||
[[
|
[[
|
||||||
|
Loading…
Reference in New Issue
Block a user