From c9e2adbbc8fd7a5398c8c66d21f0e02dc7b60203 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Mon, 8 Nov 2021 23:13:05 +0100 Subject: Add new lunarvin updates --- .config/nvim/lua/core/treesitter.lua | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to '.config/nvim/lua/core/treesitter.lua') diff --git a/.config/nvim/lua/core/treesitter.lua b/.config/nvim/lua/core/treesitter.lua index 59adda4..b56c245 100644 --- a/.config/nvim/lua/core/treesitter.lua +++ b/.config/nvim/lua/core/treesitter.lua @@ -1,4 +1,3 @@ - local M = {} local Log = require "core.log" @@ -17,8 +16,17 @@ M.config = function() disable = { "latex" }, }, context_commentstring = { - enable = false, - config = { css = "// %s" }, + enable = true, + config = { + -- Languages that have a single comment style + typescript = "// %s", + css = "/* %s */", + scss = "/* %s */", + html = "", + svelte = "", + vue = "", + json = "", + }, }, -- indent = {enable = true, disable = {"python", "html", "javascript"}}, -- TODO seems to be broken @@ -72,7 +80,11 @@ M.setup = function() return end - treesitter_configs.setup(options.builtin.treesitter) + local opts = vim.deepcopy(options.builtin.treesitter) + + -- avoid running any installers in headless mode since it's harder to detect failures + opts.ensure_installed = #vim.api.nvim_list_uis() == 0 and {} or opts.ensure_installed + treesitter_configs.setup(opts) if options.builtin.treesitter.on_config_done then options.builtin.treesitter.on_config_done(treesitter_configs) -- cgit v1.2.3-70-g09d2