I've added this to my .vimrc: nnoremap <C-S-w> :tabclose<CR>, and it works!

But my problem is that CTLR+w closes the terminal tab as well, ignoring the shift key specified in the above rule. So it will conflict with the window commands, such as
CTLR+w, v (instead of splitting the window, as soon as I hit CTLR+w it tries to close a tab).

Also, the :verbose map <c-w> says there are no other conflicting mappings.

Although it must be irrelevant to the terminal (because <c-w> is showing a behavior internal to vim(closing a vim tab), I've also de-configured all the ctrl+ws from my terminal's configuration, but it's still not working as expected.


From :help CTRL-{char}, under notation section,

CTRL-{char}     {char} typed as a control character; that is, typing {char}
                while holding the CTRL key down.  The case of {char} does not
                matter; thus CTRL-A and CTRL-a are equivalent.  But on some
                terminals, using the SHIFT key will produce another code,
                don't use it then.

If your terminal can produce another keycode when shift is also pressed, you can try to tweak it to send another escape sequence for the shift combination. I could not do it in Xterm.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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