mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-15 01:40:02 -04:00
Lua things all over the place
This commit is contained in:
parent
12064efe2f
commit
1f98c2e928
1 changed files with 13 additions and 5 deletions
18
README.md
18
README.md
|
|
@ -104,7 +104,7 @@ And now you should be ready to use every functionality `nvim-treesitter` provide
|
||||||
All modules are disabled by default,
|
All modules are disabled by default,
|
||||||
so you'll need to activate them by putting this in your `init.vim` file:
|
so you'll need to activate them by putting this in your `init.vim` file:
|
||||||
|
|
||||||
```lua
|
```vim
|
||||||
lua <<EOF
|
lua <<EOF
|
||||||
require'nvim-treesitter.configs'.setup {
|
require'nvim-treesitter.configs'.setup {
|
||||||
ensure_installed = "maintained", -- one of "all", "maintained" (parsers with maintainers), or a list of languages
|
ensure_installed = "maintained", -- one of "all", "maintained" (parsers with maintainers), or a list of languages
|
||||||
|
|
@ -125,7 +125,8 @@ for a list of available modules and its options.
|
||||||
|
|
||||||
Consistent syntax highlighting.
|
Consistent syntax highlighting.
|
||||||
|
|
||||||
```lua
|
```vim
|
||||||
|
lua <<EOF
|
||||||
require'nvim-treesitter.configs'.setup {
|
require'nvim-treesitter.configs'.setup {
|
||||||
highlight = {
|
highlight = {
|
||||||
enable = true,
|
enable = true,
|
||||||
|
|
@ -136,13 +137,15 @@ require'nvim-treesitter.configs'.setup {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
EOF
|
||||||
```
|
```
|
||||||
|
|
||||||
## Incremental selection
|
## Incremental selection
|
||||||
|
|
||||||
Incremental selection based on the named nodes from the grammar.
|
Incremental selection based on the named nodes from the grammar.
|
||||||
|
|
||||||
```lua
|
```vim
|
||||||
|
lua <<EOF
|
||||||
require'nvim-treesitter.configs'.setup {
|
require'nvim-treesitter.configs'.setup {
|
||||||
incremental_selection = {
|
incremental_selection = {
|
||||||
enable = true,
|
enable = true,
|
||||||
|
|
@ -154,18 +157,21 @@ require'nvim-treesitter.configs'.setup {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
EOF
|
||||||
```
|
```
|
||||||
|
|
||||||
## Indentation
|
## Indentation
|
||||||
|
|
||||||
Treesitter based indentation (`=` vim behavior)
|
Treesitter based indentation (`=` vim behavior)
|
||||||
|
|
||||||
```lua
|
```vim
|
||||||
|
lua <<EOF
|
||||||
require'nvim-treesitter.config'.setup {
|
require'nvim-treesitter.config'.setup {
|
||||||
indent = {
|
indent = {
|
||||||
enable = true
|
enable = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
EOF
|
||||||
```
|
```
|
||||||
|
|
||||||
# External modules
|
# External modules
|
||||||
|
|
@ -280,7 +286,8 @@ Users and plugin authors can take advantage of modules by creating their own. Mo
|
||||||
|
|
||||||
You can use the `define_modules` function to define one or more modules or module groups.
|
You can use the `define_modules` function to define one or more modules or module groups.
|
||||||
|
|
||||||
```lua
|
```vim
|
||||||
|
lua <<EOF
|
||||||
require'nvim-treesitter'.define_modules {
|
require'nvim-treesitter'.define_modules {
|
||||||
my_cool_plugin = {
|
my_cool_plugin = {
|
||||||
attach = function(bufnr, lang)
|
attach = function(bufnr, lang)
|
||||||
|
|
@ -294,6 +301,7 @@ require'nvim-treesitter'.define_modules {
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
EOF
|
||||||
```
|
```
|
||||||
|
|
||||||
Modules can consist of the following properties:
|
Modules can consist of the following properties:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue