如何在Sublime Text中使用控制台 [英] How to use the console within Sublime Text

查看:1553
本文介绍了如何在Sublime Text中使用控制台的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Sublime Text 2编写程序代码,并希望在其中运行控制台以编译并运行它们.有什么方法可以将控制台命令行嵌入Sublime Text 2中?已经存在了吗?

I'm using Sublime Text 2 to code my programs, and want to run the console within it to compile and run them. Is there any way to embed the console command line inside Sublime Text 2? Is it already there?

我同时使用Windows和Linux.

I'm using both Windows and Linux.

推荐答案

我认为您可以尝试创建自定义的 Build System .工具->构建系统->新建构建系统...这是C编程语言的简单构建脚本:

I think you can try creating a custom Build System. Tools --> Build System --> New Build System... This is a simple build script for the C programming language:

{
    "cmd" : ["gcc", "$file", "-o", "$file_base_name"],
    "cmd" : ["$file_base_name"],
    "selector" : "source.c",
    "shell" : true,
    "working_dir" : "$file_path"
}

在工具"中将当前的构建系统更改为新的构建系统.当您按下CTRL + b时,它将编译您的代码并运行您的可执行文件.您可以使用一些语法和选项: http://sublimetext.info/docs/zh-CN /reference/build_systems.html 当然,您可以在构建系统中声明许多其他选项.一个非常有用的是file_regex.

Change the current build system to the new one in Tools. When you press CTRL + b it will compile your code and run your executable file. A few syntaxes and options that you can use: http://sublimetext.info/docs/en/reference/build_systems.html There are definitely many more other options that you can declare in the build system. A very useful one is file_regex.

这篇关于如何在Sublime Text中使用控制台的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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