Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use the console within Sublime Text

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?

I'm using both Windows and Linux.

like image 283
rullof Avatar asked Dec 29 '13 22:12

rullof


2 Answers

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"
}

enter image description here 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.

like image 128
Yick Leung Avatar answered Sep 21 '22 16:09

Yick Leung


Terminus is a recent plugin, highly under development. It's the best cross-platform console in Sublime Text that I have seen yet.

like image 36
Urmil Parikh Avatar answered Sep 21 '22 16:09

Urmil Parikh