diff --git a/nvim/lua/configs/conform.lua b/nvim/lua/configs/conform.lua index 1188b58..ac68636 100644 --- a/nvim/lua/configs/conform.lua +++ b/nvim/lua/configs/conform.lua @@ -1,24 +1,25 @@ local options = { - formatters_by_ft = { - lua = { "stylua" }, - css = { "prettier" }, - html = { "prettier" }, - python = { "ruff_format", "ruff_fix", "ruff_organize_imports" }, - go = { "goimports", "gofmt" }, - json = { "jq" }, - }, + formatters_by_ft = { + lua = { "stylua" }, + css = { "prettier" }, + html = { "prettier" }, + python = { "ruff_format", "ruff_fix", "ruff_organize_imports" }, + tf = { "tflint", "terraform-ls" }, + go = { "goimports", "gofmt" }, + json = { "jq" }, + }, - format_on_save = { - -- These options will be passed to conform.format() - timeout_ms = 500, - lsp_format = "fallback", - }, - -- Set the log level. Use `:ConformInfo` to see the location of the log file. - log_level = vim.log.levels.ERROR, - -- Conform will notify you when a formatter errors - notify_on_error = true, - -- Conform will notify you when no formatters are available for the buffer - notify_no_formatters = true, + format_on_save = { + -- These options will be passed to conform.format() + timeout_ms = 500, + lsp_format = "fallback", + }, + -- Set the log level. Use `:ConformInfo` to see the location of the log file. + log_level = vim.log.levels.ERROR, + -- Conform will notify you when a formatter errors + notify_on_error = true, + -- Conform will notify you when no formatters are available for the buffer + notify_no_formatters = true, } return options diff --git a/nvim/lua/configs/lspconfig.lua b/nvim/lua/configs/lspconfig.lua index 8cd3161..00d1aa3 100644 --- a/nvim/lua/configs/lspconfig.lua +++ b/nvim/lua/configs/lspconfig.lua @@ -1,53 +1,54 @@ -local configs = require "nvchad.configs.lspconfig" +local configs = require("nvchad.configs.lspconfig") configs.defaults() local servers = { - html = {}, - cssls = {}, - gopls = { - analyses = { - unusedparams = true, - }, - staticcheck = true, - gofumpt = true, - }, - ruff = { - lint = { - run = "onSave", - }, - }, - zls = {}, + html = {}, + cssls = {}, + gopls = { + analyses = { + unusedparams = true, + }, + staticcheck = true, + gofumpt = true, + }, + ruff = { + lint = { + run = "onSave", + }, + }, + zls = {}, + terraformls = {}, - pyright = { - settings = { - python = { - analysis = { - autoSearchPaths = true, - typeCheckingMode = "basic", - }, - venvPath = vim.fn.getcwd() .. "/.venv", - pythonPath = vim.fn.getcwd() .. "/.venv/bin/python3", - }, - }, - }, - ts_ls = { - settings = { - completions = { - completeFunctionCalls = true, - }, - }, - }, + pyright = { + settings = { + python = { + analysis = { + autoSearchPaths = true, + typeCheckingMode = "basic", + }, + venvPath = vim.fn.getcwd() .. "/.venv", + pythonPath = vim.fn.getcwd() .. "/.venv/bin/python3", + }, + }, + }, + ts_ls = { + settings = { + completions = { + completeFunctionCalls = true, + }, + }, + }, } local on_attach = function(client, bufnr) - configs.on_attach(client, bufnr) - client.server_capabilities.documentFormattingProvider = true + configs.on_attach(client, bufnr) + client.server_capabilities.documentFormattingProvider = true end for name, opts in pairs(servers) do - opts.on_init = configs.on_init - opts.on_attach = on_attach - opts.capabilities = configs.capabilities + opts.on_init = configs.on_init + opts.on_attach = on_attach + opts.capabilities = configs.capabilities - require("lspconfig")[name].setup(opts) + require("lspconfig")[name].setup(opts) end diff --git a/nvim/lua/plugins/init.lua b/nvim/lua/plugins/init.lua index 131e552..fba0517 100644 --- a/nvim/lua/plugins/init.lua +++ b/nvim/lua/plugins/init.lua @@ -25,6 +25,7 @@ return { "python", "typescript", "go", + "terraform", }, }, },