Skip to content

Commit

Permalink
docs: update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
jmbuhr committed Dec 27, 2023
1 parent 887f273 commit fbb136e
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,16 +121,18 @@ cmp.setup(
Activate otter for the current document with

```lua
-- table of embedded languages to look for
-- table of embedded languages to look for.
-- required (no default)
local languages = {'python', 'lua' }

-- enable completion/diagnostics
-- defaults are true
local completion = true
local diagnostics = true
-- treesitter query to look for embedded languages
-- uses injections if nil or not set
local tsquery = nil

otter.activate(languages, completion, diagnostics, tsquery)
```

Expand All @@ -143,6 +145,20 @@ and you will see code completion and diagnostics (on save).

Then use the `otter.ask_...` functions to e.g. ask for hover documentation, references or the definition.

`otter.ask_` functions fall back to regular lsp requests on the main buffer when not in an otter context.
Currently implemented functions are:

```lua
otter.ask_definition()
otter.ask_type_definition()
otter.ask_hover()
otter.ask_references()
otter.ask_document_symbols()
otter.ask_rename()
otter.ask_format()
```


### Dependencies

`otter.nvim` relies on the following plugins:
Expand All @@ -157,3 +173,4 @@ Then use the `otter.ask_...` functions to e.g. ask for hover documentation, refe

![An otter eagerly awaiting your lsp requests. Generated with DALL-E 2.](img/2022-12-23-15-59-24.png)


0 comments on commit fbb136e

Please sign in to comment.