Merge pull request #7 from cryptomilk/asn-readme

README: Suggest to use noremap and silent for key bindings
This commit is contained in:
Daniel Mathiot
2021-08-27 13:36:37 +02:00
committed by GitHub

View File

@@ -53,7 +53,8 @@ require('neogen').generate()
You can bind it to your keybind of choice, like so:
```lua
vim.api.nvim_set_keymap("n", "<Leader>nf", ":lua require('neogen').generate()<CR>", {})
local opts = { noremap = true, silent = true }
vim.api.nvim_set_keymap("n", "<Leader>nf", ":lua require('neogen').generate()<CR>", opts)
```
Calling the `generate` function without any parameters will try to generate annotations for the current function.
@@ -69,7 +70,8 @@ require('neogen').generate({
For example, I can add an other keybind to generate class annotations:
```lua
vim.api.nvim_set_keymap("n", "<Leader>nc", ":lua require('neogen').generate({ type = 'class' })<CR>", {})
local opts = { noremap = true, silent = true }
vim.api.nvim_set_keymap("n", "<Leader>nc", ":lua require('neogen').generate({ type = 'class' })<CR>", opts)
```