Using Sublime Text 2 to insert/open/update Gist from Github.com
Today we are going to set up Sublime Text 2 to manage our Gists.
First, get the Package Manager if you haven’t done so. Restart may be
required. Now, let’s pop it up, go Cmd/Ctrl + Shift + P to fire it up (Cmd mac, control windows/unix), type “Install to add a new Package”.
Now type “Gist” and select the Gist Package Now, execute it for the first time with Cmd/Ctrl+K plus Cmd/Ctrl+O.
The settings page will pop up. Set up username and password. Now, to get a token execute the following script (available here).
#!/bin/bash
#Usage ./gistToken.sh USERNAME (don't forget to chmod+x it)
#Inspired in http://www.lornajane.net/posts/2012/github-api-access-tokens-via-curl
curl -v -u $1 -X POST https://api.github.com/authorizations --data "{\"scopes\":[\"gist\"]}"
Either copy it and run it in your term, gist download it, chmod+x it and run it, or if you trust me, run from your terminal:
curl -L https://raw.github.com/gist/4100532/1609337cc431e0139486c0df11408f68f07cd20f/gistToken.sh | bash -s USERNAME
Where “USERNAME” is your Github username. Your password will be then prompted by your terminal. From there you can copy the token retrieved and paste into the settings back in Sublime Text 2. You are all set.
"Sublime Package Control"
"Gist Package for Sublime Text 2"
Written by Jose Jesus Perez Aguinaga
Related protips
1 Response
Great, thanks. Just installed it.