diff --git a/README.md b/README.md index 1047cfc..37dcd8c 100644 --- a/README.md +++ b/README.md @@ -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" +require('neogen').setup { + enabled = true, -- required for Neogen to work + input_after_comment = true, -- automatic jump (with insert mode) on inserted annotation + } +} +``` + +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" } + } + } + } + } } ```