Skip to content

Commit

Permalink
docs: Add nvim install
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielHauge committed Jul 29, 2024
1 parent 4930202 commit 26de703
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,37 @@ Build from source or install via cargo:
cargo install ebnfer
```

### Use w. Neovim (0.10.0)

Add ebnf as file type by adding the following to config: (`init.lua` fx.)

```lua
vim.filetype.add {
extension = {
ebnf = "ebnf",
},
}
```

Add lsp attach with the following lua (N.B: cmd should have `.exe` suffix on windows):

```lua
vim.api.nvim_create_autocmd("FileType", {
pattern = "ebnf",
callback = function()
vim.lsp.buf_attach_client(
0,
vim.lsp.start_client {
name = "ebnfer",
cmd = { "ebnfer" },
on_attach = on_attach,
capabilities = capabilities,
}
)
end,
})
```

## Further development

- [ ] Vs Code extension - w. general document highlighting
Expand Down

0 comments on commit 26de703

Please sign in to comment.