我如何运行VIM C程序? [英] How do I run a C program from VIM?

查看:98
本文介绍了我如何运行VIM C程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法编译和运行VIM C程序而无需键入它的文件名?

Is there a way to compile and run a C program from VIM without typing its filename ?

推荐答案

:!的gcc -o somename%放大器;&安培; ./somename 结果
当使用,%将当前打开的文件的名称作为替代内容的

:!gcc -o somename % && ./somename
When using :!, % will be subsituted by the name of the currently opened file.

当你的项目变得更大,你也可以写一个makefile并编译当前项目:让,如果有任何错误,Vim会自动跳转到他们。

When your project becomes larger, you can also write a makefile and compile the current project with :make, if there are any errors, vim will jump to them automatically.

这篇关于我如何运行VIM C程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆