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

Add whichkey support for mappings

Open aareman opened this issue 3 years ago • 7 comments

Issue Description

Type: feature request

Describe what happened (or what feature you want)

Add whichkey support for mappings so that they are easier to discover for whichkey users

This might be too much of a niche, and out of line with this plugins goals.

aareman avatar Jul 20 '21 17:07 aareman

While not exactly which key related I do think there's an issue with remembering all the various commands and shortcuts for octo. I typically end up tabbing out to a browser and googlingocto.vim to figure out which key/command sequence I need to comment on a PR.

Either adding :help support, following fugitives lead and using g? for contextual help, or adding a popup menu for actions would be invaluable.

JamesApple avatar Jul 22 '21 06:07 JamesApple

I didnt even know what whichkey was 😄 Looks interesting but Im not sure about implementing any changes for integrating with a specific plugin if there is not enough demand for it. @aareman could you put an example of what that integration would look like?

@JamesApple I tried to assign sane defaults with easy mnemonics such as ca for Comment Add, la for Label add, rr for Reaction Rocket, etc. but I think there are too many at this point and it may get confusing.

Would something like what was proposed here be of any help?

re: :help or g? any PRs are very welcome :)

pwntester avatar Jul 22 '21 09:07 pwntester

I like that idea. Fugitive vim (and all of tpopes plugins) do the documentation thing really well.

aareman avatar Jul 22 '21 11:07 aareman

could you put an example of what that integration would look like

Not OP but a simple

local ok, whichkey = pcall(require, 'which-key')
if ok then
    whichkey.register({ ... })
end

Should suffice (docs)

elken avatar Oct 07 '21 15:10 elken

For now, I have documented all mappings. Which-key should pick these descriptions and show then in the overlay menu. The remaining part would be to group the mappings if they have the same prefix.

image

pwntester avatar Jun 01 '22 12:06 pwntester

For now, I have documented all mappings. Which-key should pick these descriptions and show then in the overlay menu. The remaining part would be to group the mappings if they have the same prefix.

image

Did you merge it into the master? I dont see the docs in my nvim (using octo from latest in master)

Anyway, we have "Octo actions" to display all available actions, but I didnt satisfy, because it lacks of many operations that we need (especially when working with issues, PRs and so on) such add add comment, assign people ...

So I created a Telescope picker to select and launch all the operations available when editing issues/PRs ... and so on (actually all functions exported from octo.config )

https://github.com/tuanbass/doom-nvim/blob/tuanbass/lua/user/modules/features/github/picker.lua

image

tuanbass avatar Apr 01 '23 18:04 tuanbass