Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please do not map h and l in the floating window #3

Closed
wookayin opened this issue Mar 10, 2019 · 6 comments
Closed

Please do not map h and l in the floating window #3

wookayin opened this issue Mar 10, 2019 · 6 comments
Assignees
Labels

Comments

@wookayin
Copy link
Contributor

In commit f6fa25a, new keybindings are added: h and l for browsing prev/next commit on the line. This feature is so nice, but I feel the default keybinding is somewhat unnatural to me as h and l are also the keys for cursor movement. Please consider switching to another keys by default.

It would be also great to have those keymaps configurable, using <Plug> mappings.

@rhysd
Copy link
Owner

rhysd commented Mar 10, 2019

I thought h and l were fine since in popup window wrap is set and no editing happens so they would be never used. However, when a user wants to yank some text in the window, overwriting h or l may be inconvenient.

OK, I'll reconsider the mappings. If you have some recommendations, please let me know.

It would be also great to have those keymaps configurable, using mappings.

It would be great but a bit complicated since they are buffer local mappings. I think a user don't always define these mappings since they are effective only in popup window. We need to provide some hook functions user can define to make some keymap definitions in popup window.

@rhysd rhysd added the bug label Mar 10, 2019
@rhysd rhysd self-assigned this Mar 10, 2019
@rhysd
Copy link
Owner

rhysd commented Mar 10, 2019

I'm considering o for going back (older) since o is a mapping to enter insert mode and it is never used in popup window. Also considering going forward to O like f and F.

What do you think?

@rhysd rhysd closed this as completed in 3aef4f2 Mar 10, 2019
@wookayin
Copy link
Contributor Author

wookayin commented Mar 10, 2019

Thanks for your feedback. Actually I was thinking of Ctrl-O and Ctrl-I as they are keys for jumping to older/newer cursor position in 'jumplist' (but not super sure which one would be the best). But o and O look reasonable too (maybe we can keep both).

@rhysd
Copy link
Owner

rhysd commented Mar 11, 2019

Thank you for the suggestion. It also seems reasonable. I think I should add the functionality to map these mappings by user.

@wookayin
Copy link
Contributor Author

wookayin commented Apr 8, 2019

I find the keys <C-O> <C-I> in the popup window are causing some troubles (it would just show the source code buffers...), no reason to not map these keys to older/Older jumping. I managed to make it like:

au FileType gitmessengerpopup nmap <buffer> <C-O> o
au FileType gitmessengerpopup nmap <buffer> <C-I> O

which works as expected. Hope this can be useful for someone who find this on the web.

@rhysd
Copy link
Owner

rhysd commented Apr 8, 2019

Actually it's a bug of git-messenger.vim (it should close popup when its buffer is switched). For now, your configuration is a good way to avoid the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants