How to run a shell command through vimscript?

試著忘記壹切 提交于 2019-12-01 16:11:13

There is a system() function in vim,try this:

:call system('date')

I do this with traditional vi, so I assume it would work with vim as well.

In my .exrc I have:

map ^_ !}fmt 71 72^M

(That's a ^_ entered by typing ctrl-V ctrl-_, and a ^M entered by typing ctrl-V ctrl-M

When I hit ctrl-_ in vi, it reformats my current line to 72 characters.

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