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

pref(cmp)!: update keymap for cmp.close #598

Merged
merged 1 commit into from
Mar 26, 2023

Conversation

Jint-lzxy
Copy link
Collaborator

This commit changes the keymap for cmp.close from <C-e> to <C-w>.

This way:

  • Makes the keymap more intuitive and easier to memorize (<C-w> --> Close the focused window on most platforms)
  • Makes cmp.close easier to type (w is closer to <CTRL> than e)

As this change does not conflict with <C-w> in normal mode, no conflicting keymap was found for the time being.

@ayamir
Copy link
Owner

ayamir commented Mar 26, 2023

No problem, but this line also needs to be modified if so.

completion but just want to new a line, you can use `<C-e>`{normal} to close the

This commit changes the keymap for `cmp.close` from `<C-e>` to `<C-w>`.

This way:
* Makes the keymap more intuitive and easier to memorize
    (`<C-w>` -> Close the focused window on most platforms)
* Makes `cmp.close` easier to type _(`w` is closer to `<CTRL>` than `e`)_

As this change does not conflict with `<C-w>` in normal mode, no
conflicting keymap was found for the time being.
@Jint-lzxy
Copy link
Collaborator Author

109881e

@Jint-lzxy Jint-lzxy requested a review from ayamir March 26, 2023 03:08
@ayamir ayamir merged commit 4b1684a into ayamir:main Mar 26, 2023
@Jint-lzxy Jint-lzxy deleted the pref/cmp-keymap branch March 26, 2023 13:30
@kang8
Copy link
Contributor

kang8 commented Mar 29, 2023

By the way, the default behavior of <C-w> is to delete the word before the cursor in neovim, see :h i_CTRL_w. This may have an impact on some users.

Also, in nvim-cmp, if <C-e> is not overridden, its default behavior is to call abort().

boomker pushed a commit to boomker/uvcode-nvim that referenced this pull request Apr 4, 2023
pref(cmp)!: update keymap for `cmp.close`

(cherry picked from commit 4b1684a)
YanTree pushed a commit to YanTree/nvim that referenced this pull request Apr 9, 2023
pref(cmp)!: update keymap for `cmp.close`
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.

3 participants