ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

C# Compile & Run

by chrokh ST2/ST3

Build and run single C# files from Sublime Text 2.

Details

  • 2016.10.18.09.30.03
  • github.​com
  • github.​com
  • 3 years ago
  • 3 hours ago
  • 6 years ago

Installs

  • Total 28K
  • Win 22K
  • OS X 4K
  • Linux 3K
Nov 15 Nov 14 Nov 13 Nov 12 Nov 11 Nov 10 Nov 9 Nov 8 Nov 7 Nov 6 Nov 5 Nov 4 Nov 3 Nov 2 Nov 1 Oct 31 Oct 30 Oct 29 Oct 28 Oct 27 Oct 26 Oct 25 Oct 24 Oct 23 Oct 22 Oct 21 Oct 20 Oct 19 Oct 18 Oct 17 Oct 16 Oct 15 Oct 14 Oct 13 Oct 12 Oct 11 Oct 10 Oct 9 Oct 8 Oct 7 Oct 6 Oct 5 Oct 4 Oct 3 Oct 2 Oct 1
Windows 2 14 10 8 9 13 6 10 5 8 10 11 6 8 10 8 4 8 5 6 11 9 11 29 11 7 11 6 15 12 13 5 10 12 8 9 10 12 9 11 7 10 10 20 12 11
OS X 0 1 0 0 0 2 0 0 1 1 1 2 0 1 1 0 1 1 0 1 2 1 1 1 0 1 0 1 0 4 1 1 2 0 0 2 1 1 1 2 0 2 1 0 1 1
Linux 0 1 1 1 0 4 0 0 1 2 2 3 4 1 3 0 1 4 3 3 5 1 1 0 4 2 1 1 1 1 0 1 3 0 1 1 1 1 0 1 1 1 2 2 0 1

Readme

Source
raw.​githubusercontent.​com

Build and run single C# files from Sublime Text 2 on OSX and Windows.

Usage

With any *.cs file open. - Cmd + b Compile filename.cs into filename.exe in current folder and output errors - Shift + Cmd + b Run filename.exe in current folder

About

The aim of this plugin is to provide easy and fast and overhead-free access to the C# language. Without having to load heavy applications such as Visual Studio or Xamarin. This plugin provides a C# sandbox (usable for schools or other learning environments) and is not intended to be used to build production applications.

Dependencies

  • Assumes you have mcs and mono commands available in your PATH. For Windows you should have csc in your PATH. If you have previously installed Xamarin Studio or Mono Develop you should have these available in your path. If you don't please read more at here or here

  • SublimeFixMacPath (for Mac users) . Required because of updates to Mac OS. Enables Sublime to load your PATH variable.

Installation

Using Package Manager (recommended)

You can now install the C# build system through the package manager channel. The package is called “C# Compile & Run”

The old-school way

  1. cd ~/Library/Application\ Support/Sublime\ Text\ 2/Packages/
  2. git clone git@github.com:ChrOkh/chsharp-build-singlefile-sublime-text-2.git CSharpSinglefile

Code-completion

If you want Visual Studio-style code completion, be sure to also install the awesome plugin CompleteSharp (available via package manager)

Example

Now we can write minimalistic C# console applications:

using System;
class MainClass{
  public static void Main(){
    Console.WriteLine("Hello world");
  }
}