Update README.md

This commit is contained in:
Daniel Mathiot
2021-08-23 09:16:48 +02:00
committed by GitHub
parent 429fec6e3d
commit b85cd29627

View File

@@ -10,9 +10,9 @@
* [Features](#features) * [Features](#features)
* [Requirements](#requirements) * [Requirements](#requirements)
* [Installation](#installation) * [Installation](#installation)
* [Usage](#usage)
* [Configuration](#configuration) * [Configuration](#configuration)
* [Supported Languages](#supported-languages) * [Supported Languages](#supported-languages)
* [Usage](#usage)
* [GIFS](#gifs) * [GIFS](#gifs)
* [Contributing](#contributing) * [Contributing](#contributing)
@@ -43,17 +43,28 @@ use {
} }
``` ```
## Usage
I exposed a command `:Neogen` to generate the annotations.
You can bind it to your keybind of choice, like so:
```lua
vim.api.nvim_set_keymap("n", "<Leader>ng", ":Neogen<CR>", {})
```
It'll generate the annotations provided by neogen.
## Configuration ## Configuration
```lua ```lua
require('neogen').setup { require('neogen').setup {
enabled = true, -- required for Neogen to work enabled = true, -- required for Neogen to work
input_after_comment = true, -- automatic jump (with insert mode) on inserted annotation input_after_comment = true, -- (default: true) automatic jump (with insert mode) on inserted annotation
} }
} }
``` ```
The configuration file a language is in `lua/configurations/{lang}.lua`. The configuration file for a language is in `lua/configurations/{lang}.lua`.
_Note: Be aware that Neogen uses Treesitter to operate. You can install [TSPlayground](https://github.com/nvim-treesitter/playground) to check the AST._ _Note: Be aware that Neogen uses Treesitter to operate. You can install [TSPlayground](https://github.com/nvim-treesitter/playground) to check the AST._
@@ -84,17 +95,6 @@ There is a list of supported languages and fields, with their annotation style
|---|---|---| |---|---|---|
| lua | Emmylua | `@param`, `@varargs`, `@return` | | lua | Emmylua | `@param`, `@varargs`, `@return` |
## Usage
I exposed a command `:Neogen` to generate the annotations.
You can bind it to your keybind of choice, like so:
```lua
vim.api.nvim_set_keymap("n", "<Leader>ng", ":Neogen<CR>", {})
```
It'll generate the annotations provided by neogen.
## GIFS ## GIFS
![](./.images/recording_1.mov) ![](./.images/recording_1.mov)