nix-community / kickstart-nix.nvim

❄️ A dead simple Nix flake template repository for Neovim derivations [maintainer=@mrcjkb]
GNU General Public License v2.0
231 stars 10 forks source link

which-key plugin #9

Closed dorekhov1 closed 8 months ago

dorekhov1 commented 8 months ago

Hi, thanks for this work, it has been very helpful to get started with my neovim setup on nixos. This is probably the best approach I've seen to handle neovim configurations on nixos!

I have configured the which-key plugin with the simple require('which-key').setup() (after installing it with nix), and it works perfectly fine except for registers. When I press " nothing happens. The plugin works fine outside the kickstart-nix setup, so I am wondering if there might be any configs that would prevent the plugin from working properly with registers.

P.S. I think in general it would be a good idea to add this plugin to the setup to help people a) figure out what the default binding are, b) set and memorize new bindings

mrcjkb commented 8 months ago

Hey :wave:

Thanks for the nice feedback! :smile:

If I just add which-key to this configuration, and call require('which-key').setup {} (with the defaults), it works fine. I noticed it doesn't work in my personal config either. In my case it's because another plugin (tmux.nvim) also defines a keymap for ", which overrides which-key's keymap.

You can find out if that's happening in your config by executing :map " in cmd mode. For example, in my case it outputs:

:map "
x  "           * <Cmd>lua require("which-key").show("\"", {mode = "v", auto = true})<CR>
n  "           * v:lua.tmux.sync_registers('"')

This is useful for debugging any keymap that doesn't work as you expect it to.

P.S. I think in general it would be a good idea to add this plugin to the setup to help people a) figure out what the default binding are, b) set and memorize new bindings

I've considered this before, and actually used to include wf.nvim (which is similar, but has a more Helix-like UI). While I use which-key myself, I ended up deciding that it (and wf.nvim) are a bit too opinionated for a kickstarter setup.

dorekhov1 commented 8 months ago

Ah, that's right, I also do have tmux.nvim conflicting with it and I did not check the :map " 😅 Thanks for pointing it out!

As for the

I ended up deciding that it (and wf.nvim) are a bit too opinionated for a kickstarter setup.

I feel like with a kickstarter setup you are forced to decide on some keymaps, which has to be a bit opinionated already, so having a tool to help identify/navigate your keymaps would be very helpful (especially for someone who is fairly new to neovim, like myself).

mrcjkb commented 8 months ago

Ah, what a coincidence :smile:

I feel like with a kickstarter setup you are forced to decide on some keymaps, which has to be a bit opinionated already, so having a tool to help identify/navigate your keymaps would be very helpful (especially for someone who is fairly new to neovim, like myself).

That's a fair point. I guess I can re-add it.