Recently I’ve found the nixvim project and decided to learn something about NVim that goes beyond saving and exiting the editor.
I tried enabling a plugin and play with its keybinding. Apparently such an easy task was too complex for me.
The plugin I chose is “neo-tree”. I wanted to add a binding which toggles the file tree panel, so I added this to my nixvim module:
programs.nixvim = {
enable = true;
# ...
keymaps = [
{
action = "<cmd>Neotree toggle<CR>";
key = "C-b";
mode = "n";
options = {
desc = "Toggle Tree View.";
};
}
];
# ...
};
However, pressing CTRL+b has no effect in the app, but typing the command “:Neotree toggle” manually in NVim has the desired effect.
The entire config file is here: https://github.com/bratfizyk/dotFiles/blob/f9f0a7775620552c38ec9ac04b8ffce0f83f117b/apps/nixvim.nix