Closed kozer closed 7 months ago
Hi @kozer ,
Thanks for reporting. I'm not using which-key
, do you know how to fix this?
Thank you and best regards, David
No unfortunately. I tried ( but not put much effort into it). ). I'm willing to try to fix it, but can you guide me through debugging? How can I try my changes without pushing?
I am also having the same issue with whichkey
. :Gen
works as expected.
Hi @kozer ,
Thank you! If you're using lazyvim
, you can set it to dev: true
:
{'David-Kunz/gen.nvim', dev = true},
clone the repository and set the path
require('lazy').setup({...}, {dev = {path = "<your_path_to_parent_folder_of_repo>"}})
Thank you @David-Kunz ! I'll try to work on it asap ! Thanks for the info you provided! They are very useful!
I am also using Lazy and have which-key installed. I experienced the exact same issue when I had defined the key bindings in keys
inside the plugin config. I solved the issue by setting the keymaps outside of the plugin config using the regular vim.keymap.set
method instead. So I don't think which-key is necessarily the problem here.
If I'm not mistaken, this has something to do with how ":" and "
Try using something like this for the rhs of your keybind:
:<c-u>Gen<cr>
I am also using Lazy with which-key enabled, haven't faced any issue
The problem seems to arise when using either "" (nothing and therefore assuming an Editor command) or "
Take the following lazy.nvim configuration:
return {
"David-Kunz/gen.nvim",
keys = {
{ "<leader>ga", ":Gen<CR>", desc = "Ollama Generate", mode = { "n", "v" } }, -- This Works
-- { "<leader>ga", "<cmd>Gen<CR>", desc = "Ollama Generate", mode = { "n", "v" } }, -- This does NOT Work
-- { "<leader>ga", "Gen<CR>", desc = "Ollama Generate", mode = { "n", "v" } }, -- This does NOT Work
},
config = function(_, _)
-- vim.keymap.set("n", "<leader>ga", ":Gen<CR>", { silent = true }) -- This Works
-- vim.keymap.set("v", "<leader>ga", ":Gen<CR>", { silent = true }) -- This Works
require("gen").model = "llama2"
end,
}
Hi @kozer ,
Is this issue solved?
Hi @kozer ,
Is this issue solved?
I also had this issue. Based on @vitorf7 's answer I switched all of my <cmd>
to :
and it all works fine now for me.
Thanks for the confirmation, @RingOfStorms !
I'm using lazyvim, and I have added a keybinding for
gen.nvim
. It seems that because which-key is triggered, the content of the buffer is empty and so the$text
parameter. ( In visual mode ). If I use:
to trigger theGen
command, it seems it works as expected.