diffview.nvim icon indicating copy to clipboard operation
diffview.nvim copied to clipboard

[Feature] action to view current keybinds

Open jemag opened this issue 3 years ago • 1 comments

There is quite a lot of mappings that are possible and, unfortunately, I have a terrible memory.

It could be nice to have an action that would show all the current keybinds for the current context (depending on whether we are in the view, file_panel, file_history_panel, etc). Something like actions.show_keymaps

Examples:

For example, with Neotree pressing ? will show

image

Or similar thing in Undotree:

image

jemag avatar Jul 03 '22 15:07 jemag

@jemag An implementation with a floating window could possibly be nicer. But in the meantime you could add these mappings:

require('diffview').setup({
  keymaps = {
    file_panel = {
      ["?"] = "<Cmd>h diffview-maps-file-panel<CR>",
    },
    file_history_panel = {
      ["?"] = "<Cmd>h diffview-maps-file-history-panel<CR>",
    },
  }
})

Although, I noticed that the documentation for the mappings is outdated, and it's missing some of the new keymaps.

I don't think I'm gonna find time to work on this anytime soon, so if you're willing to contribute a PR - either updating the documentation, or implementing a custom help popup - I would greatly appreciate it.

sindrets avatar Jul 28 '22 00:07 sindrets