Skip to content

Commit 46b3468

Browse files
committed
update readme
1 parent 68838dd commit 46b3468

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

README.md

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,11 @@ require'quarto'.setup{
5454
enabled = false,
5555
languages = { 'r', 'python', 'julia' },
5656
diagnostics = {
57-
enabled = false,
57+
enabled = true,
58+
triggers = { "BufEnter", "InsertLeave", "TextChanged" }
59+
},
60+
cmpSource = {
61+
enabled = true,
5862
},
5963
},
6064
keymap = {
@@ -65,7 +69,7 @@ require'quarto'.setup{
6569

6670
## Language support (WIP)
6771

68-
This might need quite a few resources, especially for multi-language docuemnts,
72+
This might need quite a few resources, especially for multi-language documents,
6973
as it maintains hidden buffers for all the embedded languages in your quarto document (R, python and julia) and
7074
talks to language servers attached to each.
7175

@@ -100,6 +104,23 @@ lua require'quarto'.enableDiagnostics
100104
After enabling the language features, you can open the hover documentation
101105
for R, python and julia code chunks with `K` (or configure a different shortcut).
102106

107+
### Autocompletion
108+
109+
`quarto-nvim` now comes with a completion source for [nvim-cmp](https://github.com/hrsh7th/nvim-cmp) to deliver swift autocompletion for code in quarto code chunks.
110+
With the quarto language features enabled, you can add the source in your `cmp` configuration:
111+
112+
```lua
113+
-- ...
114+
sources = {
115+
{ name = 'quarto' },
116+
}
117+
-- ...
118+
```
119+
120+
Limitation: Currently this only works for one of the languages in a multi-language document. I am on it!
121+
122+
### R diagnostics configuration
123+
103124
To make diagnostics work with R you have to configure the linter a bit, since the language
104125
buffers in the background separate code with blank links, which we want to ignore.
105126
Otherwise you get a lot more diagnostics than you probably want.

0 commit comments

Comments
 (0)