Reputation: 2099
I see a few entries here about making Shift-Tab work in vim, but none of them addresses the failure when it's in Cygwin, running at a Windows command prompt. In that environment, Shift-Tab works for me exactly like an unshifted tab, and my attempts at remapping have failed:
:imap <S-Tab> ^D
[ this is a real Ctrl-D, entered with Ctrl-V before it ]:imap
[ typed Ctrl-V, Shift-Tab here; got a Tab character inserted ]So it seems that the Shift modifier is being ignored. Any thoughts about how to proceed? Thanks.
Upvotes: 1
Views: 1741
Reputation: 392911
I don't have windows right here now, but look whether your vimrc contains
behave mswin
source ...\mswin.vim
In that case,
:e +g/mswin/norm!\ 0i" $MYVIMRC
should automatically comment these out. Relaunch vim, and inspect whether there are existing mappings:
:verbose map <S-Tab>
will show you any existing mappings, and where it was last defined, so you can find the script/plugin that is causing this (:he :verbose-cmd
)
HTH
Update to the comment:
Well - blimey, turns out that Shift-Tab is magically impossible with Win32 Consoles. Never noticed.
Perhaps it is because I
Could you try with mintty? I'd think I'd have noticed such a hairy incompatibility over the years. But, you never know :)
Upvotes: 0
Reputation: 6778
That won't work in the Cygwin console because it sends the same keycode for both Tab and Shift+Tab: ^I
.
You might want to install Cygwin's mintty terminal emulator, which sends the standard keycode for Shift+Tab: \e[Z
.
Upvotes: 2
Reputation: 55009
Instead of messing with the Cygwin version, I suggest you remove it and install the native version instead. With that, you can map Shift-Tab without issues, even when starting Vim from a bash shell.
Upvotes: 1