-
I am not sure why this is happening but whenever I am starting my neovim, treesitter is installing all the parsers which are mentioned in Below is my config for local M = {
"nvim-treesitter/nvim-treesitter",
run = ":TSUpdate",
event = "BufReadPost",
dependencies = {
{ "JoosepAlviste/nvim-ts-context-commentstring" },
{ "nvim-treesitter/nvim-treesitter-context" },
{ "nvim-treesitter/nvim-treesitter-textobjects" },
{ "p00f/nvim-ts-rainbow" },
{
"nvim-treesitter/playground",
cmd = { "TSPlaygroundToggle" },
},
},
}
function M.config()
local parsers = require("nvim-treesitter.parsers")
require("nvim-treesitter.configs").setup({
ensure_installed = vim.g.enable_treesitter_ft,
-- Auto install parsers, if missing, for the current buffer
auto_install = false,
highlight = { enable = true },
rainbow = {
enable = true,
extended_mode = true,
},
matchup = { enable = true },
autotag = { enable = true },
indent = {
enable = true,
disable = { "css" },
},
playground = {
enable = true,
updatetime = 25,
persist_queries = false,
},
context_commentstring = {
enable = true,
enable_autocmd = false,
},
query_linter = {
enable = true,
use_virtual_text = true,
lint_events = { "BufWrite", "CursorHold" },
},
incremental_selection = {
enable = true,
keymaps = {
init_selection = "<localleader>tv",
node_incremental = "<localleader>tv",
scope_incremental = "]v",
node_decremental = "[v",
},
},
textobjects = {
lookahead = true,
select = {
enable = true,
keymaps = {
["af"] = "@function.outer",
["if"] = "@function.inner",
["ac"] = "@class.outer",
["ic"] = "@class.inner",
["aC"] = "@conditional.outer",
["iC"] = "@conditional.inner",
},
},
swap = {
enable = true,
swap_next = {
["[w"] = "@parameter.inner",
},
swap_previous = {
["]w"] = "@parameter.inner",
},
},
move = {
enable = true,
set_jumps = true,
goto_next_start = {
["]m"] = "@function.outer",
["]c"] = "@class.outer",
},
goto_next_end = {
["]M"] = "@function.outer",
["]C"] = "@class.outer",
},
goto_previous_start = {
["[m"] = "@function.outer",
["[c"] = "@class.outer",
},
goto_previous_end = {
["[M"] = "@function.outer",
["[C"] = "@class.outer",
},
},
tree_docs = {
enable = true,
keymaps = {
doc_node_at_cursor = "<localleader>tc",
doc_all_in_range = "<localleader>tc",
},
},
lsp_interop = {
enable = true,
peek_definition_code = {
["df"] = "@function.outer",
["dF"] = "@class.outer",
},
},
},
})
local parser_config = parsers.get_parser_configs()
parser_config.markdown.filetype_to_parsername = "octo"
end
return M |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 12 replies
-
Can you try removing the lazy cache file and see if that solves your issue? |
Beta Was this translation helpful? Give feedback.
-
I've had the same issue, clearing the cache file didn't unfortunately help. I solved the issue by clearing the entire nvim data folder and for good measure the cache as well. I'm not sure if that helps with your bug hunting, but I've also had packer installed when I just tried to hotswap lazy in. At one point I was digging through treesitters source code to see whats going on, since I noticed treesitter downloading the parsers to nvims data folder, then "finishing" and removing them again. |
Beta Was this translation helpful? Give feedback.
-
This still happens to me, deleted everything related to nvim and build it again from source, deleted it from everywhere but still happens. |
Beta Was this translation helpful? Give feedback.
-
Clearing out my old Packer plugins ( Putting this as top level answer so it's hopefully more discoverable. |
Beta Was this translation helpful? Give feedback.
Can you try removing the lazy cache file and see if that solves your issue?