Yueyoum
Yueyoum

Reputation: 3073

vimscript: how to call a function in insert mode?

in vim insert mode:

module:function|
               ^
               cursor at here

I wanna press combined key (e.g. C-z) to delete the function.

module:|
       ^
       cursor at here

The key point is that: can not exit the insert mode

how to do that?

Upvotes: 3

Views: 2121

Answers (1)

SolaWing
SolaWing

Reputation: 1722

directly input: <C-o>db

<C-o>will execute a normal command,then back to insert.

You may add a map to execute directly:

ino <C-z> <C-o>db

By the way, there is a built-in key:<C-w>, which backwards delete word.

Upvotes: 5

Related Questions