Damjan 9000 77d74fac16 Add type hints to plugins that were extracted from init.lua
Based on:

    commit 177ff6148391742ccb7aaa93c05b95cd6fc853e2
    Author:     orip <oriori1703@gmail.com>
    AuthorDate: Sat Apr 26 14:35:04 2025 +0300

    Add type hints to plugin options where possible

    This could help beginners to get autocompletion, catch mistakes earlier,
    and allow them to skip the docs for simple configs.

    This is not perfect because a lot of the plugins type all of their keys
    as required, even though they have defaults, but this is good enough.
2026-03-15 20:24:45 +01:00

38 lines
1.3 KiB
Lua

---@module 'lazy'
---@type LazySpec
return {
{ -- Highlight, edit, and navigate code
'nvim-treesitter/nvim-treesitter',
lazy = false,
build = ':TSUpdate',
branch = 'main',
-- [[ Configure Treesitter ]] See `:help nvim-treesitter-intro`
config = function()
local parsers = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' }
require('nvim-treesitter').install(parsers)
vim.api.nvim_create_autocmd('FileType', {
callback = function(args)
local buf, filetype = args.buf, args.match
local language = vim.treesitter.language.get_lang(filetype)
if not language then return end
-- check if parser exists and load it
if not vim.treesitter.language.add(language) then return end
-- enables syntax highlighting and other treesitter features
vim.treesitter.start(buf, language)
-- enables treesitter based folds
-- for more info on folds see `:help folds`
-- vim.wo.foldexpr = 'v:lua.vim.treesitter.foldexpr()'
-- vim.wo.foldmethod = 'expr'
-- enables treesitter based indentation
vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()"
end,
})
end,
},
}
-- vim: ts=2 sts=2 sw=2 et