Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
jmbuhr committed Dec 19, 2022
1 parent 68838dd commit 46b3468
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,11 @@ require'quarto'.setup{
enabled = false,
languages = { 'r', 'python', 'julia' },
diagnostics = {
enabled = false,
enabled = true,
triggers = { "BufEnter", "InsertLeave", "TextChanged" }
},
cmpSource = {
enabled = true,
},
},
keymap = {
Expand All @@ -65,7 +69,7 @@ require'quarto'.setup{

## Language support (WIP)

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

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

### Autocompletion

`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.
With the quarto language features enabled, you can add the source in your `cmp` configuration:

```lua
-- ...
sources = {
{ name = 'quarto' },
}
-- ...
```

Limitation: Currently this only works for one of the languages in a multi-language document. I am on it!

### R diagnostics configuration

To make diagnostics work with R you have to configure the linter a bit, since the language
buffers in the background separate code with blank links, which we want to ignore.
Otherwise you get a lot more diagnostics than you probably want.
Expand Down

0 comments on commit 46b3468

Please sign in to comment.