Saturday, February 1, 2014

[Resolved]: Difference in Arrow keys: in buffer window vs in command window; and normal mode vs spell completion

In the context of using vim inside ConEmu64, I think I have resolved why
the arrwo keys behaved differently depending on how vim was started.

Short answer: The situations in which the arrow keys did not work had
the mapping ":nnoremap <ESC> q:<C-W>_". A fix that allows keeping this
mapping while also allowing the arrow keys to work is to add a new
mapping along the lines of ":map <esc>*A k". With this one mapping not
only the arrow keys but the function keys start working too!

Although I came up with the fix, I don't really understand why the above
fix works: for example,

1) what the heck does <esc> have to do with the arrow and function
keys?

2) why does just one mapping to the up motion 'k' fix all the arrow
and functions keys?

3) after the fix is implemented, why does ":verbose map <esc>*A" show
"k*A" and not just "k"?

Here's how I came up with the fix; would appreciate any insight on the
above questions (and question 4 below) from people more knowledgeable:

What helped in coming up with the fix was looking at the output of ":set
termcap" which contains:

t_ku <Up> ^[O*A

Based on vague recollection of what I have seen on this mailing list, I
figured the "^[" (or "<ctrl-[>") part played the role of <esc>. I also
noticed that hitting the <up> key resulted in the command window with
the entry "*A". I then remembered my mapping ":nnoremap <ESC> q:<C-W>_".

I then decided to try ":map <esc>*A k", and found that not only did the
<up> start working, but also all the other arrow keys and the function
keys. Now for a fourth question:

4) I believe <esc> is just '^[' (or ctrl-[) -- so, in the fix, why is
there no mention of the 'O' of "^[O*A"?

--Suresh






--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments: