Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Console for Sublime Text 2

I'm a beginner in C# and trying to use Sublime Text for my editor. But the default console doesn't seem to support "Console.ReadLine();" I can't find anywhere that I can type my input with.

I searched some plug-ins, and found this REPL and CSharpreter. However, REPL doesn't seem to support C#

enter image description here

and even when I try to load other languages, error message like this pops up.

enter image description here

What can be a good solution? Please help!

like image 349
viz Avatar asked Apr 15 '14 12:04

viz


People also ask

How do I bring up the console in Sublime Text?

Use Ctrl + ' to open the console. When Ctrl + ` is pressed, Sublime Text does not receive anything.

How do I open terminal in Sublime Text 2?

Press ctrl + ~ (for opening terminal)

How do I run sublime from command prompt?

Open command prompt and type sysdm. In Advanced tab, select Environment variables. Under system variables, select variable named " Path " and click Edit . Add " C:\Program Files\Sublime Text; " to the end of the existing string. Save the changes and restart command prompt.


2 Answers

You're looking for a combination of scriptcs, scriptcs-sublime and SublimeREPL. They will let you write and execute C# code inside Sublime Text easily.

Steps to install:

  1. Install chocolatey (like apt-get for Windows) by running the following PowerShell command:

    @powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%systemdrive%\chocolatey\bin

  2. Install scriptcs by running the following command in your CLI

    cinst scriptcs

  3. Install Sublime Package Control (if you don't have it already). You can find the installation guide here.

  4. Go to Menu > Tools > Command Palette and type Install Package, then find and install

    1. scriptcs
    2. SublimeREPL
  5. Restart Sublime

  6. Go to Menu > Tools > Command Palette and select SublimeREPL: ScriptCS.

You should now be running the scriptcs REPL inside Sublime Text :)

scriptcs REPL in Sublime

like image 107
khellang Avatar answered Nov 15 '22 00:11

khellang


If you want to develop C# code, MS Visual Studio is best way to do it.

It has also express edition which is free.

like image 21
OvD Avatar answered Nov 15 '22 00:11

OvD