t9md / atom-vim-mode-plus

vim-mode improved
https://atom.io/packages/vim-mode-plus
MIT License
1.4k stars 111 forks source link

Disable Esc for Normal mode during autocomplete #1150

Closed charlesangus closed 3 years ago

charlesangus commented 3 years ago

Esc normally rejects the autocomplete suggestion, but vim-mode-plus overrides this behaviour - with vim-mode-plus on, the autocomplete suggestion is rejected and you are returned to Normal mode, which is unlikely to be what you want.

This change limits the vim-mode-plus keybinding of Esc to only work outside of autocomplete. Ctrl-c and ctrl-[ still work to exit autocomplete and return to Normal mode.

Fixes #1149

samu commented 3 years ago

To revert this configuration, you can put this in your keymap:

# ---START revert changes from https://github.com/t9md/atom-vim-mode-plus/pull/1150
#
# Copied from https://github.com/t9md/atom-vim-mode-plus/blob/e01aa3d9336f41af643152f98f3a84eb33f81568/keymaps/vim-mode-plus.cson#L12
#
# all
# -------------------------
'atom-text-editor.vim-mode-plus':
  'escape': 'vim-mode-plus:reset-normal-mode'

# all except normal
# -------------------------
'atom-text-editor.vim-mode-plus:not(.normal-mode)':
  'escape': 'vim-mode-plus:activate-normal-mode'
# ---END
t9md commented 3 years ago

I had casually merged and got some reports this time change broke their existing workflow. I understand their desire, so I reverted #1150.

I have explicit the autocomplete-plus:cancel keybind in my local keymap.cson. @charlesangus pls bind "escape" in your keymap.cson if you need.

'atom-text-editor.vim-mode-plus.insert-mode.autocomplete-active':
  'ctrl-g': 'autocomplete-plus:cancel'