On Thu, May 11, 2006 at 03:51:55AM -0700, Gerald Lai wrote:
> [GVim 7.0 release for Windows]
> 
> This is how I do my PageUp/Down:
> 
>   inoremap <PageDown>         <C-o><C-d><C-o><C-d><C-o><C-y>
>   inoremap <PageUp>           <C-o><C-u><C-o><C-u><C-o><C-e>
> 
> If I do
> 
>   inoremap <PageDown>  
>   <C-r>="\<lt>C-o>\<lt>C-d>\<lt>C-o>\<lt>C-d>\<lt>C-o>\<lt>C-y>"<CR>
>   inoremap <PageUp>    
>   <C-r>="\<lt>C-o>\<lt>C-u>\<lt>C-o>\<lt>C-u>\<lt>C-o>\<lt>C-e>"<CR>
> 
> it does not work.
> 
> This
> 
>   inoremap <PageDown>  <C-r>="\<lt>C-o>\<lt>C-d>\<lt>C-d>\<lt>C-y>"<CR>
>   inoremap <PageUp>    <C-r>="\<lt>C-o>\<lt>C-u>\<lt>C-u>\<lt>C-e>"<CR>
> 
> works.
> 
> Sticky "\<C-o>" while in <C-r>=?

     Let me try to simplify the example.  The mapping does not seem to
be important here, and the only control character we need is <C-O>.

     If, for some reason, I want to back up two words in Insert mode,
then I can type (not literally)
        <C-o>b<C-o>b
(assuming that I do not want to use <C-Left> for some reason).
Next, I type (still not literally)
        <C-r>="\<C-o>b"<CR>
and I go back one word:  so far, so good.  Next,
        <C-r>="\<C-o>b\<C-o>b"<CR>
does not behave as expected ... at least, not as I expected!  But
        <C-r>="\<C-o>bb"<CR>
does back me up two words.  As you say, the <C-O> seems to be "sticky":
the bb is treated as one Normal-mode command.

     I agree that this behavior seems odd and inconsistent.

HTH                                     --Benji Fisher

Reply via email to