-- ============================================================================ -- Treesitter - Syntax Highlighting -- ============================================================================ return { { 'nvim-treesitter/nvim-treesitter', build = ':TSUpdate', event = { 'BufReadPost', 'BufNewFile' }, dependencies = { 'nvim-treesitter/nvim-treesitter-textobjects', }, config = function() require('nvim-treesitter.configs').setup({ -- Parser die automatisch installiert werden ensure_installed = { -- Primary 'typescript', 'tsx', 'javascript', 'go', -- Supporting 'lua', 'vim', 'vimdoc', 'html', 'css', 'json', 'yaml', 'toml', 'markdown', 'markdown_inline', 'bash', 'dockerfile', 'git_config', 'git_rebase', 'gitcommit', 'gitignore', }, -- Auto-install parser wenn fehlt auto_install = true, -- Syntax highlighting highlight = { enable = true, additional_vim_regex_highlighting = false, }, -- Indentation indent = { enable = true, }, -- Incremental selection incremental_selection = { enable = true, keymaps = { init_selection = '', node_incremental = '', scope_incremental = false, node_decremental = '', }, }, -- Text objects textobjects = { select = { enable = true, lookahead = true, keymaps = { ['af'] = '@function.outer', ['if'] = '@function.inner', ['ac'] = '@class.outer', ['ic'] = '@class.inner', }, }, move = { enable = true, set_jumps = true, goto_next_start = { [']f'] = '@function.outer', [']c'] = '@class.outer', }, goto_next_end = { [']F'] = '@function.outer', [']C'] = '@class.outer', }, goto_previous_start = { ['[f'] = '@function.outer', ['[c'] = '@class.outer', }, goto_previous_end = { ['[F'] = '@function.outer', ['[C'] = '@class.outer', }, }, }, }) end, }, }