forked from rafi/vim-config
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtreesitter.lua
More file actions
83 lines (75 loc) · 1.53 KB
/
treesitter.lua
File metadata and controls
83 lines (75 loc) · 1.53 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
-- plugin: nvim-treesitter
-- see: https://github.com/nvim-treesitter/nvim-treesitter
-- rafi settings
-- Setup treesitter
require("nvim-treesitter.configs").setup({
-- all, maintained, or list of languages
ensure_installed = {
"bash",
"c",
"css",
"dockerfile",
"dot",
"fish",
"html",
"java",
"javascript",
"json",
"json5",
"jsonc",
"lua",
"markdown",
"python",
"regex",
"rust",
"tsx",
"typescript",
"vim",
"yaml",
},
highlight = {
enable = true,
disable = { "vim" },
},
additional_vim_regex_highlighting = false,
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,
-- Let other plugins (kommentary) call 'update_commentstring()' manually.
enable_autocmd = false,
},
-- See: https://github.com/windwp/nvim-ts-autotag
autotag = {
enable = true,
filetypes = {
"html",
"javascript",
"javascriptreact",
"typescriptreact",
"svelte",
"vue",
},
},
})