neovim: configure oil keymaps

This commit is contained in:
Dmitriy Pleshevskiy 2025-01-03 16:16:04 +03:00
parent 900e9a189f
commit 0c1c74fd6c
Signed by: pleshevskiy
GPG key ID: 17041163DA10A9A2

View file

@ -104,4 +104,28 @@ in
) ++ lib.optionals config.plugin.oil-nvim.enable [
{ mode = "n"; lhs = "-"; rhs = cmd "Oil"; }
];
plugin.oil-nvim.setupSettings =
let
withOpts = action: opts: [ action (nf "opts" opts) ];
withMode = mode: action: [ action (nf "mode" mode) ];
nMode = withMode "n";
in
{
use_default_keymaps = false;
keymaps = {
"g?" = nMode "actions.show_help";
"-" = nMode "actions.parent";
"_" = nMode "actions.open_cwd";
"gs" = nMode "actions.change_sort";
"gx" = "actions.open_external";
"g." = nMode "actions.toggle_hidden";
"${lib.mod.CR}" = "actions.select";
"${ctrl "t"}" = withOpts "actions.select" { tab = true; };
"${ctrl "v"}" = withOpts "actions.select" { vertical = true; };
"${ctrl "s"}" = withOpts "actions.select" { horizontal = true; };
"${ctrl "p"}" = "actions.preview";
"${ctrl "r"}" = "actions.refresh";
};
};
}