diff --git a/README.md b/README.md index 90e7233..0dee74f 100644 --- a/README.md +++ b/README.md @@ -80,13 +80,16 @@ vim.api.nvim_set_keymap("n", "nc", ":lua require('neogen').generate({ ty ### Cycle between annotations -I added support passing cursor positionings in templates. +I added support passing cursor positionings in templates. That means you can now cycle your cursor between different parts of the annotation. -That means you can now cycle your cursor between different parts of the annotation. +To configure it to the keybind of your choice, you can do something like this: -The default keybind is `` in insert mode. +```lua +local opts = { noremap = true, silent = true } +vim.api.nvim_set_keymap("n", "", ":lua require('neogen').jump_next()", opts) +``` -If you want to add `` completion instead, be sure you don't have a completion plugin. If so, you have to configure them: +If you want to use a key that's already used for completion purposes, take a look at the code snippet here:
nvim-cmp diff --git a/lua/neogen.lua b/lua/neogen.lua index 55518dc..ce33b5c 100644 --- a/lua/neogen.lua +++ b/lua/neogen.lua @@ -142,6 +142,14 @@ neogen.setup = function(opts) if neogen.configuration.enabled == true then neogen.generate_command() vim.api.nvim_set_keymap("i", neogen.configuration.jump_map, "lua require('neogen').jump_next()", {}) + vim.notify( + [[ +[neogen] Future deprecation: `jump_map` option will be deprecated in favor of user keybinds. +You can do something like this: +vim.api.nvim_set_keymap("n", "", ":lua require('neogen').jump_next()", { silent = true, noremap = true }) + ]], + vim.log.levels.WARN + ) end end