97 lines
		
	
	
		
			2.2 KiB
		
	
	
	
		
			Lua
		
	
	
	
	
	
			
		
		
	
	
			97 lines
		
	
	
		
			2.2 KiB
		
	
	
	
		
			Lua
		
	
	
	
	
	
return {
 | 
						|
  'nvim-treesitter/nvim-treesitter',
 | 
						|
  dependencies = {
 | 
						|
    'nvim-treesitter/nvim-treesitter-textobjects',
 | 
						|
    { 'nvim-treesitter/nvim-treesitter-context', opts = {} },
 | 
						|
    -- TODO: Fork this and add CMake support
 | 
						|
    -- TODO: Add shell support (sh/bash/zsh if/for/while/etc)
 | 
						|
    'RRethy/nvim-treesitter-endwise',
 | 
						|
  },
 | 
						|
  build = ':TSUpdate',
 | 
						|
  config = function()
 | 
						|
    require('nvim-treesitter').setup()
 | 
						|
    require('nvim-treesitter.configs').setup({
 | 
						|
      sync_install = false,
 | 
						|
      highlight = { enable = true },
 | 
						|
      indent = { enable = false },
 | 
						|
 | 
						|
      -- List of languages that must be available
 | 
						|
      ensure_installed = {
 | 
						|
        'asm',
 | 
						|
        'bash',
 | 
						|
        'c',
 | 
						|
        'cmake',
 | 
						|
        'cpp',
 | 
						|
        'css',
 | 
						|
        'csv',
 | 
						|
        'cuda',
 | 
						|
        'diff',
 | 
						|
        'disassembly',
 | 
						|
        'dockerfile',
 | 
						|
        'dot',
 | 
						|
        'doxygen',
 | 
						|
        'git_config',
 | 
						|
        'git_rebase',
 | 
						|
        'gitattributes',
 | 
						|
        'gitignore',
 | 
						|
        'glsl',
 | 
						|
        'go',
 | 
						|
        'gpg',
 | 
						|
        'hlsl',
 | 
						|
        'html',
 | 
						|
        'ini',
 | 
						|
        'javascript',
 | 
						|
        'jq',
 | 
						|
        'json',
 | 
						|
        'julia',
 | 
						|
        'llvm',
 | 
						|
        'lua',
 | 
						|
        'make',
 | 
						|
        'markdown',
 | 
						|
        'meson',
 | 
						|
        'ninja',
 | 
						|
        'objc',
 | 
						|
        'objdump',
 | 
						|
        'printf',
 | 
						|
        'proto',
 | 
						|
        'python',
 | 
						|
        'query',
 | 
						|
        'regex',
 | 
						|
        'requirements',
 | 
						|
        'rst',
 | 
						|
        'ssh_config',
 | 
						|
        'strace',
 | 
						|
        'tmux',
 | 
						|
        'toml',
 | 
						|
        'vim',
 | 
						|
        'vimdoc',
 | 
						|
        'xml',
 | 
						|
        'yaml',
 | 
						|
      },
 | 
						|
 | 
						|
      -- After opening statements insert end statements
 | 
						|
      endwise = { enable = true },
 | 
						|
 | 
						|
      -- Text objects using Tree-sitter groups
 | 
						|
      textobjects = {
 | 
						|
        select = {
 | 
						|
          enable = true,
 | 
						|
          lookahead = true,
 | 
						|
          -- include_surrounding_whitespace = true,
 | 
						|
          keymaps = {
 | 
						|
            -- Function text objects
 | 
						|
            ['af'] = '@function.outer',
 | 
						|
            ['if'] = '@function.inner',
 | 
						|
            -- Parameter/argument text objects
 | 
						|
            ['a,'] = '@parameter.outer',
 | 
						|
            ['i,'] = '@parameter.inner',
 | 
						|
            -- Comment text objects
 | 
						|
            ['a/'] = '@comment.outer',
 | 
						|
            ['i/'] = '@comment.inner',
 | 
						|
          },
 | 
						|
        },
 | 
						|
      },
 | 
						|
    })
 | 
						|
  end
 | 
						|
}
 |