Skip to content

Commit bdb8e81

Browse files
committed
feat: add new options to lsp and treesitter
1 parent f8ed507 commit bdb8e81

File tree

3 files changed

+27
-4
lines changed

3 files changed

+27
-4
lines changed

customization/how-it-works.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ return {
3535
lsps = {},
3636
formatters = {},
3737
treesitter = {},
38+
treesitter_ignore = {},
3839
gitsigns = {},
3940
noice = {},
4041
theme = {

customization/installing-lsps.mdx

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,10 @@ return {
2424

2525
- Inside the `lsps` table, add a new entry for the desired language server.
2626
The key should be a unique identifier for the LSP, and the value should be an
27-
empty table. This table is used to configure the specific settings and `on_attach`
28-
function for the LSP through lspconfig. For example, to install the `prismals`
29-
language server, your configuration would look like this:
27+
empty table. This table is used to configure the specific `settings`, `init_options`,
28+
`cmd` and `on_attach` function for the LSP through lspconfig.
29+
For example, to install the `prismals` language server, your configuration
30+
would look like this:
3031

3132
```lua better-vim.lua
3233
return {
@@ -45,12 +46,21 @@ to find the language server you want to install.
4546
You can refer to the documentation of the specific LSP or lspconfig for the
4647
available options and their meanings.
4748

48-
To add settings or customize the `on_attach` function, see the example below:
49+
To add `settings`, `init_options`, `cmd` or customize the `on_attach` function,
50+
see the example below:
4951

5052
```lua better-vim.lua
5153
return {
5254
lsps = {
5355
tsserver = {
56+
cmd = {
57+
-- tsserver cmd options live here. If you don't have custom cmd, you don't need
58+
-- to add this section.
59+
},
60+
init_options = {
61+
-- tsserver init_options live here. If you don't have custom init_options, you don't need
62+
-- to add this section.
63+
},
5464
settings = {
5565
-- tsserver settings live here. If you don't have settings, you don't need
5666
-- to add this section.

customization/plugins.mdx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,18 @@ return {
129129
}
130130
```
131131

132+
### Ignoring some Treesitter plugins
133+
134+
If you are using `treesitter = "all"`, but want to ignore some plugins, you can
135+
use a table on `treesitter_ignore` entry:
136+
137+
```lua better-vim.lua
138+
return {
139+
treesitter = "all",
140+
treesitter_ignore = { "hoon" },
141+
}
142+
````
143+
132144
📢 Please, check out [treesitter's official documentation](https://github.com/nvim-treesitter/nvim-treesitter#supported-languages)
133145
to see a list of all supported languages.
134146

0 commit comments

Comments
 (0)