Repository navigation
Expand file tree
/
Copy pathtreesitter.lua
More file actions
56 lines (54 loc) · 1.46 KB
/
Copy pathtreesitter.lua
File metadata and controls
56 lines (54 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
-- plugin: nvim-treesitter
-- see: https://github.com/nvim-treesitter/nvim-treesitter
-- rafi settings
local parser_configs = require('nvim-treesitter.parsers').get_parser_configs()
parser_configs.http = {
install_info = {
url = 'https://github.com/NTBBloodbath/tree-sitter-http',
files = { 'src/parser.c' },
branch = 'main',
},
}
require('nvim-treesitter.configs').setup({
ensure_installed = 'maintained', -- all, maintained, or list of languages
highlight = {
enable = true,
},
-- incremental_selection = {
-- enable = true,
-- keymaps = {
-- init_selection = 'gnn',
-- node_incremental = 'grn',
-- scope_incremental = 'grc',
-- node_decremental = 'grm',
-- },
-- },
indent = {
enable = true,
},
refactor = {
highlight_definitions = { enable = true },
highlight_current_scope = { enable = true },
},
-- See: https://github.com/nvim-treesitter/nvim-treesitter-textobjects
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',
},
},
},
-- See: https://github.com/JoosepAlviste/nvim-ts-context-commentstring
context_commentstring = {
enable = true,
-- The plugin caw.vim will automatically detect and use this plugin itself
enable_autocmd = false,
},
})