Update treesitter

This commit is contained in:
a.shalimov 2026-09-21 17:19:55 +03:00
parent d623d74c5d
commit 0abf2af78b
5 changed files with 34 additions and 31 deletions

View file

@ -65,8 +65,7 @@ local function fzf_lua_markdown_headings()
end
local query = vim.treesitter.query.parse('markdown', [[
(atx_heading
(atx_h1_marker)) @heading
(atx_heading) @heading
]])
local tree = parser:parse()[1]
@ -75,7 +74,7 @@ local function fzf_lua_markdown_headings()
for id, node in query:iter_captures(root, bufnr, 0, -1) do
local start_row, start_col, end_row, end_col = node:range()
local lnum = start_row + 1 -- Treesitter is 0-indexed, Vim is 1-indexed
local text = vim.treesitter.get_node_text(node, bufnr)
local text = vim.treesitter.get_node_text(node, bufnr):gsub("%s+$", "")
table.insert(headings, {
lnum = lnum,

View file

@ -30,6 +30,10 @@ local servers = {
settings = {
-- Ruff language server settings go here
logLevel = "error",
lint = {
-- I001: import block un-sorted/un-formatted (isort)
ignore = { "I001", "UP032" },
},
},
},
},

View file

@ -1,13 +1,7 @@
return {
"nvim-treesitter/nvim-treesitter",
-- open this plugin on two events:
-- BufReadPre - open existing file
-- BufNewFile - open new file
event = { "BufReadPre", "BufNewFile" },
build = ":TSUpdate", -- Run whenever this plugin is installed or updated
dependencies = {
"windwp/nvim-ts-autotag", -- Auto-closing functionality within treesitter
},
'nvim-treesitter/nvim-treesitter',
lazy = false,
build = ':TSUpdate',
config = function()
require "custom/treesitter"
end,

View file

@ -1,18 +1,24 @@
require 'nvim-treesitter.configs'.setup {
ensure_installed = {
"python",
"lua",
"vim",
"vimdoc",
"query",
"elixir",
"heex",
"javascript",
"html",
"go",
"markdown",
},
sync_install = false,
highlight = { enable = true },
indent = { enable = true },
local parsers = {
"python",
"lua",
"vim",
"vimdoc",
"query",
"elixir",
"heex",
"javascript",
"html",
"go",
"markdown",
"markdown_inline",
}
require("nvim-treesitter").install(parsers)
vim.api.nvim_create_autocmd("FileType", {
pattern = "*",
callback = function()
pcall(vim.treesitter.start)
end,
})

View file

@ -21,8 +21,8 @@ opt.softtabstop = 2
-- Disable swap files creation
opt.swapfile = false
-- Add line at 80 symbols
opt.colorcolumn = "99"
-- Add line at 100 symbols
opt.colorcolumn = "100"
-- config to set up clipboard as default register
opt.clipboard:append("unnamedplus")