Update README.md

This commit is contained in:
Daniel Mathiot
2021-08-23 09:08:51 +02:00
committed by GitHub
parent 84920a1621
commit 4b294e456a

View File

@@ -46,15 +46,31 @@ use {
## Configuration
```lua
use {
"danymat/neogen",
config = function()
require('neogen').setup {
enabled = true, -- required for Neogen to work
input_after_comment = true, -- automatic jump (with insert mode) on inserted annotation
}
end,
requires = "nvim-treesitter/nvim-treesitter"
}
```
The configuration file a language is in `lua/configurations/{lang}.lua`.
If you're not satisfied with the default configuration for the language, you can change the defaults like this:
_Note: Be aware that Neogen uses Treesitter to operate. You can install [TSPlayground](https://github.com/nvim-treesitter/playground) to check the AST._
```lua
require('neogen').setup {
enabled = true, -- required for Neogen to work
languages = {
lua = {
template = {
{ nil, "- " }, -- First annotation line will be {default_comment}- (in lua ---)
{ "parameters", "- @param %s any" }, -- If matching parameters, will ouput --- @param {param} any
{ "vararg", "- @vararg any" },
{ "return_statement", "- @return any" }
}
}
}
}
}
```