FeiyouG / commander.nvim

Create and manage keybindings and commands in a more organized manner, and search them quickly through Telescope

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`vim.keymap.set`

dtomvan opened this issue · comments

This looks really nice, but I have a suggestion:

With the (almost there) release of nvim 0.7, :h vim.keymap.set() was introduced. Maybe this could take similar syntax, but with an additional description field? This would make it both easier for the user (they do not need to change much about their configs, if they were to start using this plugin), and for the developer (they can just forward everything to vim.keymap.set())

Interesting idea. I will look into this once I have time.

just to clarify @dtomvan, you are proposing to mimic the interface right? not to depend on it. I don't think that api should be used since the current release of nvim is still 0.6.1,and most people will just have that.

I believe 0.7 is going to be released today. Even if I am going to introduce a new interface to add commands to command_center based on the new API, I will definitely not remove the old interface nor the support for the previous version of neovim.

With ecb8b48, command_center now lets you to pass a Lua function as a command.

With ecb8b48, command_center now lets you to pass a Lua function as a command.
That's awesome, extra flexibility
does that require neovim 0.7?

Supposedly, if you want use lua function, you'd have to use neovim 0.7 because it requires the new api. Otherwise, you can stick with 0.6 (see this section)

However, I've tested this on 0.6.1, and it worked... not sure why.

awesome, thanks for the clarification

Supposedly, if you want use lua function, you'd have to use neovim 0.7 because it requires the new api. Otherwise, you can stick with 0.6 (see this section)

However, I've tested this on 0.6.1, and it worked... not sure why.

Ok, here is how it works:

If you are on neovim 0.6, then you can add a Lua function as a cmd and execute it in command_center, but you are not able to bind it to a keymap.

If you are on neovim 0.7, then you can both bind the Lua function to a keymap and execute it in command_center.

Hope this clear things up