Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

vimscript: how to call a function in insert mode?

Tags:

vim

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?

like image 481
Yueyoum Avatar asked Nov 16 '25 08:11

Yueyoum


1 Answers

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.

like image 73
SolaWing Avatar answered Nov 19 '25 10:11

SolaWing



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!