I've been trying to get Shift+Tab or
<S-Tab> to work in VIM and I can't figure it out.
I read this document, but the
remap solution only works for normal mode (because if I press Shift+Tab, VIM reads the literal escape
^] in the Shift+Tab escape sequence
^]]Z, which causes VIM to leave insert mode!), and the
set t_kb="<stuff>" also only works for normal mode on my vim. You can test the latter option by entering:
exe 'set t_kB=' . nr2char(27) . '[Z' nmap <S-Tab> ihello world! imap <S-Tab> hello world!
...then try pressing Shift+Tab. The first remap does work, but the second remap is ignored. I also tried the
xmodmap from the terminal, then entering VIM, and still I have the same issue.
Can anything be done here?
t_kB <S-Tab> ^[[Zwhen I do
^[is control character equiv. to
ESC). In the other env. I get "Key code not set" (!) What do you see? And what do you see when you enter
Shift-Tabwhile in Insert mode?
t_kB <S-Tab> ^[[Z. Despite this the
^[seems to be interpreted literally from insert mode. I actually figured out a super hacky way to use Shift+Tab to navigate the popup menu in Insert mode by creating a normal mode remap for
[Z. May post it later, but hopefully someone can figure out the main problem first.
vim -u NONE filename)? BTW, never use
imap, etc. unless you are doing so deliberately and for a specific reason. Instead use
inoremap, etc. (That's not likely to be the cause in this case but better safe than sorry.)
-u NONEdisables all mappings, even ones explicitly declared after the fact? I tried doing the
S-Tabmaps and then as a test, creating the map
nmap <Space> ihello world!, but instead the bell rings/VIM ignores my command. So can't seem to test it this way. Typing
:map <Space>verifies the mapping was created.