Update README.md
This commit is contained in:
28
README.md
28
README.md
@@ -46,15 +46,31 @@ use {
|
||||
## Configuration
|
||||
|
||||
```lua
|
||||
use {
|
||||
"danymat/neogen",
|
||||
config = function()
|
||||
require('neogen').setup {
|
||||
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" }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user