Mapping keys only in diff mode #1206
Unanswered
tommyalatalo
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Not 100% if it'll work but maybe you could try in the if vim.wo.diff then
vim.keymap.set("n", "<leader>n", "<cmd>diffget //3<cr>", { desc = "whatever you want" })
end |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to map keys for vim-fugitive that are only active in diff mode, but I wasn't able to find any examples of how to approach this in the lazy docs.
Specifically what I'm trying to do is to map
<leader>n
to run:diffget //3
when in diff mode, and I found the example seen below of another mapping on stackoverflow showing how to check for the diff mode. But I'm not sure if this kind of expression is possible with thekeys
config for the plugin, or if it needs to be done some other way?Beta Was this translation helpful? Give feedback.
All reactions