From 1ad80a85ee24c697fec0a1612827f5218aecde57 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Fri, 27 Aug 2021 13:07:51 +0200 Subject: [PATCH] README: Suggest to use noremap and silent for key bindings --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 77d9c7a..0138c69 100644 --- a/README.md +++ b/README.md @@ -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", "nf", ":lua require('neogen').generate()", {}) +local opts = { noremap = true, silent = true } +vim.api.nvim_set_keymap("n", "nf", ":lua require('neogen').generate()", 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", "nc", ":lua require('neogen').generate({ type = 'class' })", {}) +local opts = { noremap = true, silent = true } +vim.api.nvim_set_keymap("n", "nc", ":lua require('neogen').generate({ type = 'class' })", opts) ```