sublime
Package Control
简介: 管理sublime中的插件
安装Package control :https://packagecontrol.io/installation
下载插件:ctrl+shift+p,输入Install Package,再输入插件名称即可
如果出现错误:There are no packages available for installation,是因为没有FQ
查看已经安装的插件:ctrl+shift+p,输入list Package
删除插件:ctrl+shift+p,输入remove Package
配置c++编译环境
Tools→Build System→New Build System
复制下面的代码,保存文件
{
"cmd": ["g++", "\({file}", "-std=c++11", "-o", "\){file_path}\\\({file_base_name}", "&", "start", "cmd", "/c", "\){file_path}\\\({file_base_name} & echo. & pause"],
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)\)", "working_dir": "${file_path}",
"selector": "source.c, source.c++", "shell": true,
"encoding":"cp936",
"variants":
[
{
"name" : "Build Only",
"cmd":["g++", "${file}", "-std=c++11", "-o", "${file_path}\\\\${file_base_name}"]
},
{
"name" : "Run Only",
"cmd" : ["start", "cmd", "/c", "${file_path}\\\\${file_base_name} & echo. & pause"]
}
,
{
"name" : "Pipe Build and Run",
"cmd":["g++", "${file}", "-std=c++11", "-o", "${file_path}\\\\${file_base_name}","&","${file_path}\\\\${file_base_name}", "<","${file_path}\\\\in",">","${file_path}\\\\out"]
},
{
"name" : "Pipe Run Only",
"cmd" : ["${file_base_name}", "<","in",">","out"]
}
]
}
设置编译环境为新的编译环境
ctrl+shift+b调出编译命令
ctrl+b 执行上一次编译命令
修改ctrl+b为编译加运行
preferences->key-bindings 加入下面代码
推荐插件
ChineseLocalizations:汉化sublime
常用命令
build:编译
view:sublime布局调整
自定义补全
经常在码代码的时候,为了减少代码的输入,会创建代码的片段,在需要的时候直接呼出即可。
https://www.jianshu.com/p/ba94d8f52413