diff --git a/lua/crentist/lazy/lsp.lua b/lua/crentist/lazy/lsp.lua index 73e6595..1dc7450 100644 --- a/lua/crentist/lazy/lsp.lua +++ b/lua/crentist/lazy/lsp.lua @@ -85,7 +85,11 @@ return { }) vim.lsp.config('terraformls', { - filetypes = { 'terraform', 'terraform-vars', 'tf' } + filetypes = { 'terraform', 'terraform-vars' }, + -- run terraformls once for a git repo + root_dir = function(bufnr, on_dir) + on_dir(vim.fs.root(bufnr, '.git')) + end }) end }