ZyX wrote:

> Consider the following code:
>     vim -u NONE -c 'set nocompatible' \
>                 -c 'inoremap $ <C-o>ch-' \
>                 -c 'execute "normal a$\ea"' \
>                 -c 'wq! result.txt'
> You will have `-a' inside a result.txt file, while it is supposed to be a 
> single 
> `-' (`\e' passed to normal should result in going to normal mode, but it does 
> not).

The CTRL-O starts another level of Insert mode, thus the Escape takes
you out of the CTRL-O one and you are still in Insert mode.

Did you intend to do:
                 -c 'inoremap $ <C-o>ch-<Esc>' \

-- 
I still remember when I gave up Smoking, Drinking and Sex.  It was the
most *horrifying* hour of my life!

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
You received this message from the "vim_dev" 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

Raspunde prin e-mail lui