ref: Add future deprecation notices for jump_map

This commit is contained in:
danymat
2021-11-18 12:42:12 +01:00
parent 864c6a6353
commit d7a26c15ab
2 changed files with 15 additions and 4 deletions

View File

@@ -80,13 +80,16 @@ vim.api.nvim_set_keymap("n", "<Leader>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 `<C-e>` in insert mode.
```lua
local opts = { noremap = true, silent = true }
vim.api.nvim_set_keymap("n", "<C-e>", ":lua require('neogen').jump_next()<CR>", opts)
```
If you want to add `<Tab>` 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:
<details>
<summary>nvim-cmp</summary>

View File

@@ -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, "<cmd>lua require('neogen').jump_next()<CR>", {})
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", "<C-e>", ":lua require('neogen').jump_next()<CR>", { silent = true, noremap = true })
]],
vim.log.levels.WARN
)
end
end