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

Keymaps #10

Merged
merged 3 commits into from
Apr 16, 2021
Merged

Keymaps #10

merged 3 commits into from
Apr 16, 2021

Conversation

AckslD
Copy link
Owner

@AckslD AckslD commented Apr 13, 2021

Some changes based on PR #9 by @folke

@folke
Copy link
Contributor

folke commented Apr 13, 2021

Looks great!

The problem you mention about some keys no longer working, like gg, can be easily resolved by setting vim.g.which_key_fallback_to_native_key = 1. That way everything should work as expected.

@folke
Copy link
Contributor

folke commented Apr 13, 2021

Never mind my remark about the native_key stuff. Just checked the issue you linked too. Need to figure out what I'll do with that :)

@AckslD
Copy link
Owner Author

AckslD commented Apr 13, 2021

@folke Yeah that settings indeed works for things like gg but not for operators for some reason, like gU. If you find a solution feel free to let me know :) I'd like to also setup g etc for whichkey but not doing that at the moment due to this issue. So I would be very interested if you find a way :)

end
local textmap = textmaps[leader_type]
setup_keymap(mode, {key}, keymap, textmap, opts, bufnr)
local textmap_key = initial_key..'_'..mode
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we probably should add in bufnr here is well if it's defined in opts. Will be needed once the upstream PR with buffer local which-keymaps is merged.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point @folke! I guess in most cases people would set bufnr = 0 to use the current buffer. But I'm wondering how to handle other cases. Since if we store the buffer number in textmaps then what if the buffers change? Or do buffer numbers persist in a session? Any thoughts?

@AckslD AckslD merged commit b2df076 into main Apr 16, 2021
@AckslD AckslD deleted the keymaps branch April 16, 2021 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants