78 lines
1.6 KiB
Lua
78 lines
1.6 KiB
Lua
require('nvim-treesitter.configs').setup({
|
|
ensure_installed = {
|
|
'bash',
|
|
'bibtex',
|
|
'c',
|
|
'cmake',
|
|
'comment',
|
|
'cpp',
|
|
'css',
|
|
'dockerfile',
|
|
'help',
|
|
'hjson',
|
|
'html',
|
|
'http',
|
|
'java',
|
|
'javascript',
|
|
'jsdoc',
|
|
'json',
|
|
'json5',
|
|
'JSONC',
|
|
'latex',
|
|
'llvm',
|
|
'lua',
|
|
'make',
|
|
'markdown',
|
|
'ninja',
|
|
'perl',
|
|
'php',
|
|
'proto',
|
|
'python',
|
|
'r',
|
|
'regex',
|
|
'rust',
|
|
'toml',
|
|
'vim',
|
|
'yaml',
|
|
},
|
|
highlight = {
|
|
enable = true
|
|
},
|
|
rainbow = {
|
|
enable = true,
|
|
extended_mode = true, -- Also highlight non-bracket delimiters like html tags, boolean or table: lang -> boolean
|
|
max_file_lines = nil, -- Do not enable for files with more than n lines, int
|
|
-- colors = {}, -- table of hex strings
|
|
-- termcolors = {} -- table of colour name strings
|
|
},
|
|
textobjects = {
|
|
select = {
|
|
enable = true,
|
|
|
|
-- Automatically jump forward to textobj, similar to targets.vim
|
|
lookahead = true,
|
|
|
|
keymaps = {
|
|
-- You can use the capture groups defined in textobjects.scm
|
|
["af"] = "@function.outer",
|
|
["if"] = "@function.inner",
|
|
["ac"] = "@class.outer",
|
|
["ic"] = "@class.inner",
|
|
},
|
|
},
|
|
lsp_interop = {
|
|
enable = true,
|
|
border = 'none',
|
|
peek_definition_code = {
|
|
["<leader>df"] = "@function.outer",
|
|
["<leader>dF"] = "@class.outer",
|
|
},
|
|
},
|
|
},
|
|
})
|
|
|
|
require("nvim-treesitter.install").prefer_git = true
|
|
|
|
-- local groovy_parser = require('nvim-treesitter.parsers').groovy
|
|
-- groovy_parser.groovy = 'java' -- the someft filetype will use the python parser and queries.
|