当前位置: 首页 > 编程日记 > 正文

Sublime Text 3 (含:配置 C# 编译环境)

Sublime Text 3
http://www.sublimetext.com/3
http://www.sublimetext.com/3dev

1. 关闭自动更新
   菜单:Preferences->Settings User,打开User配置文档,在大括号内加入(或更改):
    "update_check": false 
   保存关闭文件。重启软件即可。

2. 安装Package Control
   按Ctrl+`快捷键或者通过View->Show Console菜单打开命令行,粘贴代码:

import urllib.request,os; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler()) ); open(os.path.join(ipp, pf), 'wb').write(urllib.request.urlopen( 'http://sublime.wbond.net/' + pf.replace(' ','%20')).read())

如果顺利的话,此时就可以在Preferences菜单下看到Package Settings和Package Control两个菜单了。重启软件即可。

3. 安装插件:
   Preferences->Package Control(或者按Command+Shift+P)
   输入:install package 回车
   然后输入插件名称,找到插件按回车或者点击,即安装。
   
   卸载插件:
   Preferences->Package Control(或者按Command+Shift+P)
   输入:remove package 回车
   然后输入插件名称,找到插件按回车或者点击,即卸载。

   【常用插件】

   * Markdown Preview
     描述:用浏览器预览Markdown格式文档。
     用法:按Command+Shift+P,输入Preview in Browser即可中浏览器中看到预览效果了。
   
   * ConvertToUTF8
     描述:支持更多的文件编码格式,解决ANSI乱码问题。
     用法:打开或保存文件时就能自动识别中文文字。
   
   * IMESupport(Windows)
     描述:Windows平台下的输入法框光标跟谁。

   【代码插件】
   
   * SublimeCodeIntel
     描述:非常强大的代码提示插件。
   
   * Emmet
     描述:前身是 Zen Coding。它让编写 HTML 代码变得简单。
     用法:输入简写形式,然后按 Tab 键。

   * ColorPicker
     描述:颜色拾取器插件。
     用法:Command+Shift+P,输入colorpicker

   【界面】

   * SideBarEnhancements
     侧边栏右键菜单增强工具。

   【快捷键】
   * KeyMaps

4. 添加C#支持(Windows)
  1) 配置环境变量 Path
     C# 6.0
      C:\Program Files (x86)\MSBuild\14.0\Bin 
     C# 5.0
      C:\Windows\Microsoft.NET\Framework64\v4.0.30319;C:\Windows\Microsoft.NET\Framework\v4.0.30319

详细步骤参考:http://www.cnblogs.com/Bob-wei/p/4669793.html
  2)添加 CSharp Build 配置
     Tools -> Build System -> New Build System...
     粘贴:

{"shell_cmd": "csc /out:\"${file_path}/${file_base_name}.exe\" \"${file}\"","file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$","working_dir": "${file_path}","selector": "source.cs","variants":[{"name": "Build & Run","shell_cmd": "csc /out:\"${file_path}/${file_base_name}.exe\" \"${file}\" && start \"${file_base_name}.exe\" /d \"${file_path}\" \"${file_base_name}.exe\"","working_dir": "${file_path}"},{"name": "Run","shell_cmd": "start \"${file_base_name}.exe\" /d \"${file_path}\" \"${file_base_name}.exe\"","working_dir": "${file_path}"},{"name": "Build (Form)","shell_cmd": "csc /t:winexe /r:System.Windows.Forms.dll;System.Drawing.dll /out:\"${file_path}/${file_base_name}.exe\" \"${file}\"","working_dir": "${file_path}"},{"name": "Build & Run (Form)","shell_cmd": "csc /t:winexe /r:System.Windows.Forms.dll;System.Drawing.dll /out:\"${file_path}/${file_base_name}.exe\" \"${file}\" && start \"${file_base_name}.exe\" /d \"${file_path}\" \"${file_base_name}.exe\"","working_dir": "${file_path}"},{"name": "Run (Form)","shell_cmd": "start \"${file_base_name}.exe\" /d \"${file_path}\" \"${file_base_name}.exe\"","working_dir": "${file_path}"},]
}


     保存为csharp.sublime-build
     然后编辑.cs文件,就可以按Ctrl+Shift+B(Tools -> Build With...),选择编译方法,按Ctrl+B(Tools -> Build)进行编译了。

测试:新建一个 test.cs 文件,内容如下。

using System;
using System.Drawing;
using System.Windows.Forms;class Program {[STAThread]static void Main() {const string _title = "nguid";var counter = 1;var form = new Form{Text = _title,ClientSize = new Size(318, 188),AutoScaleDimensions = new SizeF(6F, 12F),AutoScaleMode = AutoScaleMode.Font,};form.Load += (ss,se) => ((Form)ss).Activate();var textBox = new TextBox {Font = new Font("Calibri",10),Multiline = true,Location = new Point(12,12),Size = new Size(294, 135),ReadOnly = true,TabIndex = 10,ScrollBars = ScrollBars.Vertical,Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right,Text = string.Format("{0}.\r\n{1}\r\n", counter++, NewGuid()),BackColor = SystemColors.Window,};textBox.Click += (ss,se) => {var line = textBox.GetLineFromCharIndex(textBox.SelectionStart);if(line>=0 && line<textBox.Lines.Length) {var guidString = textBox.Lines[line];if (string.IsNullOrWhiteSpace(guidString)){Clipboard.Clear();form.Text = _title;} else {Clipboard.SetText(guidString);form.Text = string.Format("{0} - {1}", _title, guidString);}}};form.Controls.Add(textBox);var button = new Button{Location = new Point(12,153),Size = new Size(75, 23),TabIndex = 1,Anchor = AnchorStyles.Bottom | AnchorStyles.Left,Text = "&Generate",};button.Click += (ss,se) => { textBox.Text = string.Format("{0}\r\n{1}.\r\n{2}\r\n", textBox.Text, counter++, NewGuid()); textBox.SelectionStart = textBox.Text.Length;textBox.ScrollToCaret();};form.Controls.Add(button);button = new Button{Location = new Point(100,153),Size = new Size(75, 23),TabIndex = 2,Anchor = AnchorStyles.Bottom | AnchorStyles.Left,Text = "&Clear",};button.Click += (ss,se) => textBox.Text = "";form.Controls.Add(button);button = new Button{Location = new Point(190,153),Size = new Size(75, 23),TabIndex = 3,Anchor = AnchorStyles.Bottom | AnchorStyles.Left,Text = "C&lose",};button.Click += (ss,se) => form.Close();form.Controls.Add(button);Application.Run(form);}public static string NewGuid(){var guid = Guid.NewGuid();return string.Format("{0:N}\r\n{0:D}\r\n{0:B}\r\n{0:P}", guid);}
}

按 Ctrl+Shift+B 选择  csharp - Build & Run (Form)  (下次直接按 Ctrl+B 就行了)结果如图:

转载于:https://www.cnblogs.com/Bob-wei/p/4670341.html

相关文章:

小程序仿安卓动画滑动效果滑动动画效果实现

微信小程序开发交流qq群 173683895 承接微信小程序开发。扫码加微信。 效果图&#xff1a; 源码 var start_clientY; //记录当前滑动开始的值 var end_clientY; //记录当前滑动结束的值 var animation wx.createAnimation({duration: 400 }); //初始化动画var history_dis…

react中使用scss_我如何将CSS模块和SCSS集成到我的React应用程序中

react中使用scssby Max Goh由Max Goh 我如何将CSS模块和SCSS集成到我的React应用程序中 (How I integrated CSS Modules with SCSS into my React application) I recently started on an Isomorphic React project. I wanted to use this opportunity to utilize tools that …

-bash:syntax error near unexpected token '('

在Xshell5中编写int main(int argc,char** argv)时&#xff0c; 出现-bash:syntax error near unexpected token ( &#xff1b; 可是我是按照Linux语句编写的&#xff0c;其他代码没有出错&#xff1b; 检查发现&#xff0c; Xshell5对应的Linux版本是Linux5&#xff0c;在Li…

iOS手机 相册 相机(Picker Write)

把图片写到相册UIImageWriteToSavedPhotosAlbum(<#UIImage *image#>, nil, nil, nil); ————————————————————————————从相册&#xff0c;相机获取图像设置代理《UINavigationControllerDelegate, UIImagePickerControllerDelegate》 #pragm…

php删除指定对象的属性及属性值

微信小程序开发交流qq群 173683895 承接微信小程序开发。扫码加微信。 unset($address[/Api/User/addAddress]); 删除了 address 对象的 /Api/User/addAddress 属性

前端分离的前端开发工具_使我成为前端开发人员工作的工具和资源

前端分离的前端开发工具Learning front-end development can be a bit overwhelming at times. There are so many resources and tools, and so little time. What should you pick? And what should you focus on?有时&#xff0c;学习前端开发可能会有些困难。 资源和工具…

C# 开启及停止进程

1.本篇内容转发自http://www.cnblogs.com/gaoyuchuanIT/articles/2946314.html 2. 首先在程序中引用: System.Diagnostics; 3. 开启进程: /// <summary> /// 开启进程 /// </summary> /// <param name"aProPath&quo…

COJN 0575 800601滑雪

800601滑雪难度级别&#xff1a;B&#xff1b; 运行时间限制&#xff1a;1000ms&#xff1b; 运行空间限制&#xff1a;51200KB&#xff1b; 代码长度限制&#xff1a;2000000B 试题描述Michael喜欢滑雪百这并不奇怪&#xff0c; 因为滑雪的确很刺激。可是为了获得速度&#xf…

JS删除数组指定下标并添加到数组开头

微信小程序开发交流qq群 173683895 承接微信小程序开发。扫码加微信。 代码 let id e.currentTarget.dataset.idlet arrays ;let items this.data.itemsfor (let i 0; i < this.data.items.length; i) {if (id this.data.items[i].id) {arrays items.splice(i, 1)i…

scala akka_如何对Scala和Akka HTTP应用程序进行Docker化-简单的方法

scala akkaby Miguel Lopez由Miguel Lopez 如何对Scala和Akka HTTP应用程序进行Docker化-简单的方法 (How to Dockerise a Scala and Akka HTTP Application — the easy way) Using Docker is a given nowadays. In this tutorial we will how to learn to dockerise our Sca…

Freemarker详细解释

A概念 最经常使用的概念1、 scalars&#xff1a;存储单值字符串&#xff1a;简单文本由单或双引號括起来。数字&#xff1a;直接使用数值。日期&#xff1a;通常从数据模型获得布尔值&#xff1a;true或false&#xff0c;通常在<#if …>标记中使用2、 hashes&#xff1a;…

洛谷P1057 传球游戏(记忆化搜索)

点我进入题目题目大意&#xff1a;n个小孩围一圈传球&#xff0c;每个人可以给左边的人或右边的人传球&#xff0c;1号小孩开始&#xff0c;一共传m次&#xff0c;请问有多少种可能的路径使球回到1号小孩。 输入输出&#xff1a;输入n&#xff0c;m&#xff0c;输出路径的数量。…

微信小程序 自定义导航栏,只保留右上角胶囊按钮

微信小程序开发交流qq群 173683895 承接微信小程序开发。扫码加微信。 navigationStyle 导航栏样式&#xff0c;仅支持以下值&#xff1a;default 默认样式custom 自定义导航栏&#xff0c;只保留右上角胶囊按钮 在 app.json 的 window 加上 "navigationStyle":…

azure多功能成像好用吗_如何使用Azure功能处理高吞吐量消息

azure多功能成像好用吗Authored with Steef-Jan Wiggers, Azure MVP.由Azure MVP Steef-Jan Wiggers撰写。 With Microsoft Azure, customers will push all types of workloads to its services. Workloads are ranging from datasets for Machine Learning purposes to a la…

document.all使用

document.all 一个. document.all它是在页面中的所有元素的集合。例如&#xff1a; document.all(0)一个元素 二. document.all能够推断浏览器是否是IE if(document.all) { alert("is IE!"); } 三. 也能够通过给某个元素设置id属性&#xff08;id…

微信小程序动画无限循环 掉花

微信小程序开发交流qq群 173683895 承接微信小程序开发。扫码加微信。 动画效果 源码 <!-- 动画 --><block wx:if"{{donghua}}"><view classdonghua><image bindtaphua styleleft:{{left1}}px animation"{{animationData1}}" clas…

程序员远程办公_如何从办公室变成远程程序员

程序员远程办公by James Quinlan詹姆斯昆兰(James Quinlan) My name is James, and I’m a Software Engineer at a company called Yesware, based in Boston. Yesware is the fourth job I’ve had in which I’m paid to write code, but it’s the third time now that I’…

从头学起androidlt;AutoCompleteTextView文章提示文本框.十九.gt;

文章提示可以很好的帮助用户输入信息&#xff0c;以方便。在Android它也设置有类似特征&#xff0c;而要实现这个功能需要依靠android.widget.AutoCompleteTextView完毕&#xff0c;此类的继承结构例如以下&#xff1a; java.lang.Object↳ android.view.View↳ android.widget…

微信小程序动态设置 tabBar

微信小程序开发交流qq群 173683895 承接微信小程序开发。扫码加微信。 使用微信提供的API wx.setTabBarItem(Object object) 动态设置 tabBar 某一项的内容 参数 Object object 属性类型默认值必填说明indexnumber 是tabBar 的哪一项&#xff0c;从左边算起textstring 否…

NodeJS入门--环境搭建 IntelliJ IDEA

NodeJS入门–环境搭建 IntelliJ IDEA 本人也刚开始学习NodeJS&#xff0c;所以以此做个笔记&#xff0c;欢迎大家提出意见。 1、首先 下载安装NodeJS&#xff0c;下载安装IntelliJ IDEA2、接下来我们详细介绍在IDEA中配置NodeJS 默认安装好了IDEA&#xff0c;在IDEA的file ->…

如何使用React.js和Heroku快速实现从想法到URL的转变

by Tom Schweers由汤姆史威士(Tom Schweers) 如何使用React.js和Heroku快速实现从想法到URL的转变 (How to go from idea to URL quickly with React.js and Heroku) When I was first starting out as a developer, the one thing that I wanted to do was get a web applica…

F - Count the Colors - zoj 1610(区间覆盖)

有一块很长的画布&#xff0c;现在想在这块画布上画一些颜色&#xff0c;不过后面画的颜色会把前面画的颜色覆盖掉&#xff0c;现在想知道画完后这块画布的颜色分布&#xff0c;比如 1号颜色有几块&#xff0c;2号颜色有几块。。。。*****************************************…

小程序弹窗并移动放大图片的动画效果

微信小程序开发交流qq群 173683895 承接微信小程序开发。扫码加微信。 效果图 触发条件 <block wx:if{{bg_hui_show}}> <view classbg_hui catchtaphide_bg_hui></view> <image classanimation animationData1 bindtapto_hed mode"widthFix&quo…

代码片段管理工具_VS代码片段:提高编码效率的最强大工具

代码片段管理工具by Sam Williams通过山姆威廉姆斯 VS代码片段&#xff1a;提高编码效率的最强大工具 (VS Code snippets: the most powerful tool to boost your coding productivity) 用更少的按键编写更多的代码 (Write more code with fewer keystrokes) Everyone wants t…

我的C++笔记(数据的共享与保护)

*数据的共享与保护&#xff1a; * 1.作用域&#xff1a; * 作用域是一个标识符在程序正文中有效的区域。C中标识符的作用域有函数原型作用域、局部作用域(块作用域)、类作用域和命名空间作用域。 * (1).函数原型作用域&#xff1a; * 函数原型作用域是C中最小的作用域&#xff…

最新Java中Date类型详解

一、Date类型的初始化 1、 Date(int year, int month, int date); 直接写入年份是得不到正确的结果的。 因为java中Date是从1900年开始算的&#xff0c;所以前面的第一个参数只要填入从1900年后过了多少年就是你想要得到的年份。 月需要减1&#xff0c;日可以直接插入。 这种方…

ES6 常用的特性整理

微信小程序开发交流qq群 173683895 承接微信小程序开发。扫码加微信。 1.默认参数 2.模板对象-反引号 3.多行字符串-反引号 4.解构赋值-对象&#xff0c;数组 5.增强的对象字面量- 直接给对象里面的属性赋值给变量 6.给对象的属性赋值的时候可以直接给一个参数&#xf…

crontab 最小间隔_今天我间隔了:如何找到不在数组中的最小数字

crontab 最小间隔by Marin Abernethy通过Marin Abernethy 今天我间隔了&#xff1a;如何找到不在数组中的最小数字 (Today I Spaced: how to find the smallest number that is not in the array) TIS在我的第一次技术采访中。 这是我学到的。 (TIS in my first technical int…

计算起点地址和终点地址的最短驾车距离和驾车时间

微信小程序开发交流qq群 173683895 承接微信小程序开发。扫码加微信。 需求&#xff1a; 在一个excel的xlsx表格中有很多起点的地址和终点的地址&#xff0c;要批量计算两个地址之间的距离和驾车时间&#xff0c;按照百度地图的最短距离计算。最后把得出的行驶距离和驾车时…

jmeter测试工具

jmeter的下载&#xff1a; http://jmeter.apache.org/download_jmeter.cgi 1.打开链接选择 Binaries 下.zip下载 下载完后解压 2.然后再下载java中jdk, 配置java的环境变量 JAVA_HOME 和path JAVA_HOME值中加jdk的安装目录 path后面加;%JAVA_HOME%\bin; 3.在jmeter解压目录中…