-
I have the following in my config: programs.nixvim = {
globals = {
mapleader = ",";
maplocalleader = ",";
};
keymaps = [
{
mode = "n";
key = "<leader>c";
action = "gcc";
options.noremap = true;
options.silent = true;
}
{
mode = "v";
key = "<leader>c";
action = "gc";
options.noremap = true;
options.silent = true;
}
];
}; Pressing Thanks in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 12 replies
-
I think |
Beta Was this translation helpful? Give feedback.
-
I took a look at the generated lua file, and heere is what I see: do
local __nixvim_binds = {
{ action = ";", key = ":", mode = "n" },
{ action = ":", key = ";", mode = "n" },
{ action = "P", key = "p", mode = "v" },
{ action = ":noh<cr>", key = "<leader><space>", mode = "n" },
{ action = "<nop>", key = "<left>", mode = "n" },
{ action = "<nop>", key = "<right>", mode = "n" },
{ action = "<nop>", key = "<up>", mode = "n" },
{ action = "<nop>", key = "<down>", mode = "n" },
{ action = "<nop>", key = "<left>", mode = "i" },
{ action = "<nop>", key = "<right>", mode = "i" },
{ action = "<nop>", key = "<up>", mode = "i" },
{ action = "<nop>", key = "<down>", mode = "i" },
{ action = "<nop>", key = "<left>", mode = "v" },
{ action = "<nop>", key = "<right>", mode = "v" },
{ action = "<nop>", key = "<up>", mode = "v" },
{ action = "<nop>", key = "<down>", mode = "v" },
{ action = "gcc", key = "<leader>c", mode = "n" },
{ action = "gc", key = "<leader>c", mode = "v" },
{ action = "gj", key = "j", mode = "n" },
{ action = "gk", key = "k", mode = "n" },
{ action = "o<ESC>", key = "<Enter>", mode = "n" },
{ action = "O<ESC>", key = "<S-Enter>", mode = "n" },
{ action = "i#[test]<CR>fn () {<CR>}<ESC>kwi", key = ",t", mode = "n" },
{
action = "i#[cfg(test)]<CR>mod tests {<CR>use super::*;<CR><CR>#[test]<CR>fn () {<CR>}<CR><ESC>xxxxi}<ESC>kkwwi",
key = ",tm",
mode = "n",
},
{ action = "<C-d>zz", key = "<C-d>", mode = "n" },
{ action = "<C-u>zz", key = "<C-u>", mode = "n" },
{ action = "nzzzv", key = "n", mode = "n" },
{ action = "Nzzzv", key = "N", mode = "n" },
}
for i, map in ipairs(__nixvim_binds) do
vim.keymap.set(map.mode, map.key, map.action, map.options)
end
end I am not that expereinced with Lua, but everything looks good. |
Beta Was this translation helpful? Give feedback.
-
I just checked, this way its working. I am starting to think that some plugin re-maps I will start disabling plugins one by one. |
Beta Was this translation helpful? Give feedback.
-
I discovered something new. I don't know if it is relevant, but I will post it here anyway, maybe it will light a light bulb. lsp = {
enable = true;
keymaps.lspBuf = {
"<leader>d" = "definition";
"<leader>a" = "code_action";
"<leader>i" = "implementation";
"<leader>ic" = "incoming_calls";
"<leader>f" = "format";
"<leader>h" = "hover";
"<leader>r" = "rename";
};
}; Out of the above mappings only |
Beta Was this translation helpful? Give feedback.
-
Issue solved. Like this: {
mode = "n";
key = "<leader>c";
action = "gcc";
options.remap = true;
} I found the answer here: https://www.reddit.com/r/neovim/comments/1d278fz/keymap_comment_nvim_010/.
|
Beta Was this translation helpful? Give feedback.
Issue solved. Like this:
I found the answer here: https://www.reddit.com/r/neovim/comments/1d278fz/keymap_comment_nvim_010/.
In case the link stops working in the distant future, here is a quote: