# Golang Build 官方发布 #

Sublime Text build system integration packages

Gophers,

This is our first stable release of a set of Sublime Text packages (v0.9.0):

  • ‘golangconfig’ is a developer library used to obtain information about the local Go environment. It handles configuration ($GOPATH, etc) through a combination of auto-detection and configuration. It is designed to be used by other Go-related Sublime Text packages.
  • ‘Golang Build’ provides Go toolchain integration with the Sublime build system – go build, go run, go install, go test. It is the first package to utilize the functionality of golangconfig.

Golang Build can be installed via packagecontrol.io:

  1. If you don’t already have Package Control installed, follow these instructions.
  2. Run the “Install Package” command via the command palette
  3. Type “Golang Build” and press enter

User documentation for Golang Build is available here. If you’d like to contribute to either package, there is also complete developer documentation available on Github (golangconfigGolang Build).


Please file bugs using the appropriate issue trackers on Github. For problems with Go environment detection and configuration, issues should be filed at:

For bugs related to the build command integration, issues should be filed at:

Our goal is to have other Go-related Sublime packages adopt golangconfig. This would allow users to set their Go environment configuration in one place and have that used by all of their installed Go/Sublime packages. If you are an author of a Go-related Sublime Text package, we’d love to hear your feedback on golangconfig.

Happy Editing,
The Go Team

Sublime Text 安装 GO说明

想必已经安装了st的插件管理器

直接安装名称为 “Golang Build “即可

Golang Build 源码  

Golang Build

Golang Build 文档

Golang Build 使用文档

 

问:Sublime Text 2如何跳转函数

答:CTRL+R 或者 CRTL+P输入@

问:Sublime Text 2如何跳转到多少行

答:CTRL+G

问:Sublime Text 2如何快速查找、跳转需要编辑的文件

答:前提是你打开的一个文件夹(一个项目),CTRL+P,支持模糊匹配。

问:Sublime Text 2如何快速注释

答:CTRL+/ 注释单行  CTRL+SHIFT+/注释多行

问:Sublime Text 2如何设置代码片段,并快速调用

答: 菜单:tools->new snippet

<snippet>
    <content><![CDATA[
/**
*@description:

*@author:wwek https://www.iamle.com

*@update:wwek(2013年1月22日)

*/
]]></content>
    <!-- 触发名字 -->
    <tabTrigger>readme</tabTrigger>
    <!-- 在编辑哪一种扩展名的时候使用 -->
    <scope>source.css</scope>
    <!-- 描述 -->
    <description>/* */</description>
<!-- 将文件保存在”packages/User”目录下,以sublime-snippet为扩展名。
     重启sublime text 2,该snippet即可使用了。 -->
</snippet>

Wwek的Sublime Text使用的配置

{
    "color_scheme": "Packages/Color Scheme - Default/Monokai Bright.tmTheme", //代码配色方案
    "detect_slow_plugins": false,
    "draw_minimap_border": true, //minimap边框
    "font_face": "YaHei Consolas Hybrid", //字体
    "font_size": 13.0, //字体大小
    "highlight_line": true,  //高亮当前选择行
    "indent_to_bracket": true,
    "save_on_focus_lost": true, //焦点失去时保存
    "tab_size": 4, //tab大小
    "theme": "Soda Dark.sublime-theme", //界面主题
    "translate_tabs_to_spaces": true, //自动转换tab为空格
    //"default_line_ending": "unix",  //unix风格换行符
    "trim_trailing_white_space_on_save": true, //保证在文件保存时,移除每行结尾多余空格
    "use_tab_stops": true, // translate_tabs_to_spaces设置为true,Tab和Backspace的删除/插入作用于制表符宽度 否则作用于单个空格use_tab_stops
    "ignored_packages": //需要忽略的插件
    [
        "JsFormat"
    ],
    "binary_file_patterns": //包含在side bar,但是不包含在 go to anything
    [
        "*.jpg",
        "*.jpeg",
        "*.png",
        "*.gif",
        "*.ttf",
        "*.tga",
        "*.dds",
        "*.ico",
        "*.eot",
        "*.pdf",
        "*.swf",
        "*.jar",
        "*.zip"
    ],
    "file_exclude_patterns": //排除的扩展名
    [
        "*.shtml",
        "*.pyc",
        "*.pyo",
        "*.exe",
        "*.dll",
        "*.obj",
        "*.o",
        "*.a",
        "*.lib",
        "*.so",
        "*.dylib",
        "*.ncb",
        "*.sdf",
        "*.suo",
        "*.pdb",
        "*.idb",
        ".DS_Store",
        "*.class",
        "*.psd",
        "*.db"
    ],
    "folder_exclude_patterns": //排除的文件夹
    [
        "Html",
        "upload",
        "Runtime",
        ".svn",
        ".git",
        ".hg",
        "CVS"
    ]
}

Sublime Text快捷键:

  • Ctrl+Shift+P:打开命令面板
  • Ctrl+P:搜索项目中的文件
  • Ctrl+G:跳转到第几行
  • Ctrl+W:关闭当前打开文件
  • Ctrl+Shift+W:关闭所有打开文件
  • Ctrl+Shift+V:粘贴并格式化
  • Ctrl+D:选择单词,重复可增加选择下一个相同的单词
  • Ctrl+L:选择行,重复可依次增加选择下一行
  • Ctrl+Shift+L:选择多行
  • Ctrl+Shift+Enter:在当前行前插入新行
  • Ctrl+X:删除当前行
  • Ctrl+M:跳转到对应括号
  • Ctrl+U:软撤销,撤销光标位置
  • Ctrl+J:选择标签内容
  • Ctrl+F:查找内容
  • Ctrl+Shift+F:查找并替换
  • Ctrl+H:替换
  • Ctrl+R:前往 method
  • Ctrl+N:新建窗口
  • Ctrl+K+B:开关侧栏
  • Ctrl+Shift+M:选中当前括号内容,重复可选着括号本身
  • Ctrl+F2:设置/删除标记
  • Ctrl+/:注释当前行
  • Ctrl+Shift+/:当前位置插入注释
  • Ctrl+Alt+/:块注释,并Focus到首行,写注释说明用的
  • Ctrl+Shift+A:选择当前标签前后,修改标签用的
  • F11:全屏
  • Shift+F11:全屏免打扰模式,只编辑当前文件
  • Alt+F3:选择所有相同的词
  • Alt+.:闭合标签
  • Alt+Shift+数字:分屏显示
  • Alt+数字:切换打开第N个文件
  • Shift+右键拖动:光标多不,用来更改或插入列内容
  • 鼠标的前进后退键可切换Tab文件
  • 按Ctrl,依次点击或选取,可需要编辑的多个位置
  • 按Ctrl+Shift+上下键,可替换行

 

扩展阅读
Sublime Text 使用介绍、全套快捷键及插件推荐