一、新建构建系统
保存为:
C#VS2015.sublime-build
二、编辑C#VS2015.sublime-build内容,如下:
{
"file_regex": "^(...*?):([0-9]*):?([0-9]*)",
"selector" : "source.cs",
"cmd" : "mcs $file_name",
"shell" : true,
"windows" : {
//"cmd" : "csc.exe $file_name"
"cmd": ["E:\\Tool\\SublimeText3C#VS2015.bat", "$file"],
},
"variants" : [
{
"cmd" : "mono $file_base_name.exe",
"name" : "Run",
"shell" : true,
"windows" : {
"cmd": ["start", "cmd", "/k", "${file_path}/${file_base_name}.exe"]
}
}
]
}
说明:(1)编译运行:Ctrl +B (2)运行 Ctrl + Shift +B
三、ublimeText3C#VS2015.bat内容如下
REM VS2015
CALL "D:/Program Files (x86)/Microsoft Visual Studio 14.0/Common7/Tools/vsvars32.bat"
@ECHO OFF
cd %~dp1
ECHO ------------------开始编译------------------
ECHO Compiling %~nx1.......
IF EXIST %~n1.exe (
DEL %~n1.exe
)
csc %~nx1
IF EXIST %~n1.exe (
ECHO -----------OUTPUT-----------
start %~n1
)