Skip to content

Instantly share code, notes, and snippets.

@erasin
Last active December 21, 2015 18:39
Show Gist options
  • Save erasin/6348882 to your computer and use it in GitHub Desktop.
Save erasin/6348882 to your computer and use it in GitHub Desktop.
让sublime支持项目本身的pkg库提示

项目支持,让sublime支持项目本身的pkg库提示,有两种基本的实现

一种为设定 gosublime 插件的 Setting - user 配置

{
  //"env": { "GOPATH": "$HOME/golang:$GS_GOPATH" }
  // 留空即可
  "env":{}
}

$GS_GOPATH 是 gosublime 的伪环境变量, 它自动寻找 .go文件所在的 ~/go/src 来推测 ~/go/ 为项目位置, 从而自动适应 GOPATH

另外一种为保存sublime 项目 , 修改 project_name.sublime-project 添加节点

"settings": {
  "GoSublime": {
    "env": {
      "GOPATH": "$HOME/golang/pwd" // 此处修改为项目路径
    }
  }
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment