Skip to content

Instantly share code, notes, and snippets.

@iftheshoefritz
Created July 24, 2019 19:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iftheshoefritz/70ffef7bb5a9f34f6dc28343aaaa3964 to your computer and use it in GitHub Desktop.
Save iftheshoefritz/70ffef7bb5a9f34f6dc28343aaaa3964 to your computer and use it in GitHub Desktop.

GitHub layer

img/github.png

Table of Contents

Description

This layers adds support for GitHub.

Features:

Install

Layer

To use this configuration layer, add it to your ~/.spacemacs. You will need to add github to the existing dotspacemacs-configuration-layers list in this file.

Git configuration

You will need to generate a personal access token on GitHub. This token should have the gist and repo permissions. Once this token is created, it needs to be added to your ~/.gitconfig

git config --global github.oauth-token <token>

Key Bindings

magit-gh-pulls

In a magit status buffer (SPC g s):

Key BindingDescription
# ccreate a pull request
# gget a list of (or reload) all PRs in the current repository
# ffetch the commits associated with the current PR at point
# bcreate a branch for the current PR at point
# mmerge the PR with current branch at point
# dshow a diff of the current pull request at point
# oopen PR at point in browser

Note that magit-gh-pulls will try to fast-forward the PRs whenever it is possible.

gist.el

Key BindingDescription
SPC g g bcreate a public gist with the buffer content
SPC g g Bcreate a private gist with the buffer content
SPC g g lopen the gist list buffer
SPC g g rcreate a public gist with the region content
SPC g g Rcreate a private gist with the region content

In the gist list buffer:

Key BindingDescription
/evil search
+add buffer to gist
-remove file for gist
b or oopen current gist in browser
ffetch current gist
grefresh the list
hgo left
jgo down
kgo up
Kkill current gist
lgo right
nnext search occurrence
Nnext previous occurrence
vvisual state
Vvisual-line state
yprint URL and copy it

Clone repositories

Key BindingDescription
SPC g h c /search for a repository to clone it
SPC g h c cclone and optionally fork repository
SPC g h c radd a remote that is an existing fork of selected remote
SPC g h c ffork remote in current user namespace
SPC g h c uadd upstream as remote

Browse files

Key BindingDescription
SPC g h obrowse to file on GitHub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment