How to leave insert mode with a vimscript command

251 views
Skip to first unread message

epanda

unread,
Feb 23, 2010, 2:31:42 AM2/23/10
to vim_use
Hi,

I would like to execute either CTRL-L or i_CTRL-L into a vimscript in
order to leave insert mode.
How can I do ?

Thank you

Ben Schmidt

unread,
Feb 23, 2010, 2:41:51 AM2/23/10
to vim...@googlegroups.com

Try

:stopinsert

Ben.

epanda

unread,
Feb 23, 2010, 3:45:07 AM2/23/10
to vim_use


stopinsert does not leave insertmode under vimscript

Note that I do
argdo! w!
argdo! bd!

before
stopinsert

Ben Fritz

unread,
Feb 24, 2010, 11:48:52 AM2/24/10
to vim_use

On Feb 23, 2:45 am, epanda <callingel...@hotmail.fr> wrote:
>
> stopinsert does not leave insertmode under vimscript
>

Yes, it does. That's the only thing it ever does. That's the command's
entire purpose. What do you see, instead? What *exactly* are you
trying to accomplish?

> Note that I do
> argdo! w!
> argdo! bd!
>
> before
> stopinsert

Commands you execute before :stopinsert are irrelevant. :stopinsert
stops insert mode from within a script, as soon as possible.

Reply all
Reply to author
Forward
0 new messages