How to execute a normal mode command in a vim function?

戏子无情 提交于 2019-12-06 05:47:58

To indent, you can just use

normal ==

To find also you can use

normal 2f"

or even shorter

norm <whatever you do in normal mode>

Now you might be getting what I'm trying to say.
If not, read documentation :h normal.

Try this in your function:

execute 'normal 2f"'
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!