我在OSX Yosemite上使用Sublime Text 3并安装了Gist插件。我无法通过浏览包找到Gist.sublime-settings文件,所以我只是去了首选项并找到了它并输入了我的Github用户名和密码。
这是我尝试打开或保存Gists时遇到的错误
其他人遇到此问题? Gist插件是否适用于Sublime Text 3?
当用户名/密码无法正常工作时,我看起来需要生成令牌。
默认的Gist插件设置
{
// Your GitHub API token
// see: https://github.com/condemil/Gist#generating-access-token
"token": "",
// Show GitHub organizations
// Example: "company1", "company2"
"include_orgs": [],
// Show GitHub users
// Example: "user1", "user2"
"include_users": [],
// Show the authors of Gists
"show_authors": false,
// Prefer first file name instead of description in Open Gist menu
"prefer_filename": false,
// Proxy server
// Format: "http://user:pass@proxy:port"
"https_proxy": "",
// Enterprise support
"enterprise": false,
// Github URL
// Default: Leave empty if you want to use GitHub.com
// Example: https://github.domain.com
"url": "",
// Max Gists to show (max 100 allowed by GitHub API)
"max_gists": 100,
// Only use starred gists
"use_starred": false,
// Disable the "save file..." dialog when closing a Gist
"supress_save_dialog": true,
// Update the Gist upon saving the file, suppressing the filename dialog.
"save-update-hook": true
// Limit to gists with specific prefix
//"gist_prefix": "Snippet:",
// Limit to gists with specific tag (#tag)
//"gist_tag": "snippet"
}
在此处找到生成令牌的说明: https://github.com/condemil/Gist#generating-access-token
生成令牌后,我将其放在Gist插件的用户设置文件中,但仍然出现相同的错误。
答案 0 :(得分:2)
搞定了!
而不是通过CURL命令生成令牌: https://github.com/condemil/Gist#generating-access-token
我必须在Github上生成一个令牌: https://github.com/settings/applications#personal-access-tokens
它生成了一个字符串,我将其粘贴到gist-sublime-settings文件中的"token"
键,而不是CURL命令生成的JSON。