2

What's up with Control Backspace, and Control Shift Z for the Windows cmd terminal?

I cannot seem to remap them.

All the former does in Insert Mode is type Î, and then make the "z" letter show up in the statusbar.

And bafflingly, in Normal Mode, the latter opens a new instance of cmd within cmd.

In answers to other questions, I saw that VIM does not recognize Shift - or at least, that's the way I understood it.

Well, if it doesn't recognize Shift, then why is my remap of C-Z to Undo not triggered when I press Control Shift Z?

1 Answer 1

0

What do your mapping commands look like?

In Ubuntu 18.04LTS, I have a local ftplugin/test.vim file where I added:

nnoremap <C-Z>  u
inoremap <C-Z>  <ESC>ui

I opened up a tmp.test file, added text in insert mode, changed to normal mode and pressed <ctrl>+<shift>+<z> and the insert mode changes were undone.

Similarly, staying in insertmode and pressing the same key combinations undid the text as well.

If you provide your mappings in your answer, that may help shed some light on the issue.

7
  • I am using the mapping commands from mswin.vim - which I'm sourcing - which are noremap <C-Z> u and inoremap <C-Z> <C-O>u. For backspace, I am using noremap! <C-B> <C-w>, which apparently has no effect.
    – Unknow0059
    Nov 20, 2020 at 17:04
  • Just to clarify, are you using the powershell terminal in windows? My commands were all done in ubuntu. I updated my comment to reflect that.
    – Vee
    Nov 20, 2020 at 17:14
  • 1
    I am using cmd. The same happens in Powershell, though.
    – Unknow0059
    Nov 20, 2020 at 17:18
  • 1
    All my mswin.vim mappings work fine. Putting the mapping commands in _vimrc (which is what I was already doing), but excluding the command to source mswin.vim, makes no difference.
    – Unknow0059
    Nov 20, 2020 at 19:10
  • 4
    <C-B> is not CTRL-Backspace. It is Ctrl-B, Backspace would be <BS>, but be aware of vimhelp.org/vim_faq.txt.html#faq-20.5 Nov 21, 2020 at 7:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.