i have a example:

input this in insert mode:
<c-r>="\<c-\>\<c-n>"<cr>
you will into normal mode.
but if you have a variable:
:let zz="\<c-\>\<c-n>"

then you input it in insert mode:
<c-r>=zz<cr>

the cursor changed to full cursor, and there also have a '"' sign in
screen, and if you press "k", you will goto the top of the buffer.

anyone knows why?


On 12月31日, 上午5时06分, StarWing <[email protected]> wrote:
> will, i have maped key <a-d> in a script like this:
> map <a-d> <c-\><c-n>a<c-r>=func()<cr>
> and func will change text in the buffer, and change the mode, i want
> it change to normal mode, so i return "\<c-\>\<c-n>" in func, but the
> action is very strange: when i'm in normal mode, it's very good, but i
> mustly use it in select mode, in select mode, this map didn't exit the
> select mode. some times it just in select mode, and some times it will
> make Vim suspend, if i press any key, will see this in cmdline:
> =\\^\
> and, if i change the map to:
> map <a-d> <c-\><c-n>a<c-r>="\<lt>c-\>\<lt>c-n>"<cr>
> it won't suspend the Vim, but can't exit select mode, neither.
>
> i just want to know how can i change the map, or the return value,
> makes func can control the mode affer invoke mapping.
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to