2015-06-10 02:42:11 +00:00
|
|
|
;;; packages.el --- Github Layer packages File for Spacemacs
|
|
|
|
;;
|
|
|
|
;; Copyright (c) 2012-2014 Sylvain Benner
|
|
|
|
;; Copyright (c) 2014-2015 Sylvain Benner & Contributors
|
|
|
|
;;
|
|
|
|
;; Author: Sylvain Benner <sylvain.benner@gmail.com>
|
|
|
|
;; URL: https://github.com/syl20bnr/spacemacs
|
|
|
|
;;
|
|
|
|
;; This file is not part of GNU Emacs.
|
|
|
|
;;
|
|
|
|
;;; License: GPLv3
|
|
|
|
|
|
|
|
(setq github-packages
|
|
|
|
'(
|
|
|
|
gist
|
|
|
|
git-link
|
|
|
|
github-browse-file
|
2015-10-31 01:28:58 +00:00
|
|
|
github-clone
|
2015-06-10 02:42:11 +00:00
|
|
|
;; not up to date
|
|
|
|
;; helm-gist
|
2015-08-25 19:05:06 +00:00
|
|
|
magit-gh-pulls
|
2015-06-10 02:42:11 +00:00
|
|
|
))
|
|
|
|
|
|
|
|
(defun github/init-gist ()
|
|
|
|
(use-package gist
|
|
|
|
:defer t
|
|
|
|
:init
|
|
|
|
(progn
|
2015-11-21 10:07:14 +00:00
|
|
|
(evilified-state-evilify gist-list-mode gist-list-menu-mode-map
|
|
|
|
"f" 'gist-fetch-current
|
|
|
|
"K" 'gist-kill-current
|
|
|
|
"o" 'gist-browse-current-url)
|
2015-11-18 00:38:05 +00:00
|
|
|
(spacemacs/set-leader-keys
|
2015-06-10 02:42:11 +00:00
|
|
|
"ggb" 'gist-buffer
|
|
|
|
"ggB" 'gist-buffer-private
|
|
|
|
"ggl" 'gist-list
|
|
|
|
"ggr" 'gist-region
|
|
|
|
"ggR" 'gist-region-private))))
|
|
|
|
|
|
|
|
;; this mode is not up to date
|
|
|
|
;; any contributor to make it up to date is welcome:
|
|
|
|
;; https://github.com/emacs-helm/helm-gist
|
|
|
|
;;
|
|
|
|
;; (defun github/init-helm-gist ()
|
|
|
|
;; (use-package helm-gist
|
|
|
|
;; :commands egist-mode
|
|
|
|
;; :init
|
|
|
|
;; (progn
|
|
|
|
;; (defun spacemacs/helm-gist-list ()
|
|
|
|
;; "List the gists using helm, ensure thath elgist-mode is enabled."
|
|
|
|
;; (interactive)
|
|
|
|
;; (egist-mode)
|
|
|
|
;; (helm-for-gist))
|
|
|
|
|
2015-11-18 00:38:05 +00:00
|
|
|
;; (spacemacs/set-leader-keys "ggh" 'spacemacs/helm-gist-list))
|
2015-06-10 02:42:11 +00:00
|
|
|
;; ))
|
|
|
|
|
|
|
|
(defun github/init-github-browse-file ()
|
|
|
|
(use-package github-browse-file
|
|
|
|
:defer t
|
|
|
|
:init
|
2015-11-18 00:38:05 +00:00
|
|
|
(spacemacs/set-leader-keys
|
2015-11-02 05:16:13 +00:00
|
|
|
"gho" 'github-browse-file)))
|
2015-06-10 02:42:11 +00:00
|
|
|
|
2015-10-31 01:28:58 +00:00
|
|
|
(defun github/init-github-clone ()
|
|
|
|
(use-package github-clone
|
|
|
|
:defer t
|
|
|
|
:init
|
2015-11-18 00:38:05 +00:00
|
|
|
(spacemacs/set-leader-keys
|
2015-11-02 05:16:13 +00:00
|
|
|
"gh C-c" 'github-clone)))
|
2015-10-31 01:28:58 +00:00
|
|
|
|
2015-06-10 02:42:11 +00:00
|
|
|
(defun github/init-git-link ()
|
|
|
|
(use-package git-link
|
|
|
|
:defer t
|
|
|
|
:init
|
|
|
|
(progn
|
|
|
|
|
|
|
|
(defun spacemacs/git-link-copy-url-only ()
|
|
|
|
"Only copy the generated link to the kill ring."
|
|
|
|
(interactive)
|
|
|
|
(let (git-link-open-in-browser)
|
|
|
|
(call-interactively 'git-link)))
|
|
|
|
|
|
|
|
(defun spacemacs/git-link-commit-copy-url-only ()
|
|
|
|
"Only copy the generated link to the kill ring."
|
|
|
|
(interactive)
|
|
|
|
(let (git-link-open-in-browser)
|
|
|
|
(call-interactively 'git-link-commit)))
|
|
|
|
|
2015-11-18 00:38:05 +00:00
|
|
|
(spacemacs/set-leader-keys
|
2015-11-02 05:16:13 +00:00
|
|
|
"ghl" 'git-link
|
|
|
|
"ghL" 'spacemacs/git-link-copy-url-only
|
|
|
|
"ghc" 'git-link-commit
|
|
|
|
"ghC" 'spacemacs/git-link-commit-copy-url-only)
|
2015-06-10 02:42:11 +00:00
|
|
|
;; default is to open the generated link
|
|
|
|
(setq git-link-open-in-browser t))))
|
2015-08-25 19:05:06 +00:00
|
|
|
|
|
|
|
;; magit-gh-pulls has to be loaded via a pre-config hook because the source code
|
|
|
|
;; makes assumptions about the status of the magit-mode keymaps that are
|
|
|
|
;; incompatible with the spacemacs' evilification feature.
|
|
|
|
;; To avoid errors, magit-gh-pulls must be loaded after magit, but before magit
|
|
|
|
;; is configured by spacemacs.
|
|
|
|
|
|
|
|
(defun github/init-magit-gh-pulls ()
|
|
|
|
(spacemacs|use-package-add-hook magit
|
|
|
|
:pre-config
|
|
|
|
(progn
|
|
|
|
(use-package magit-gh-pulls
|
|
|
|
:init
|
|
|
|
(progn
|
|
|
|
(defun spacemacs/load-gh-pulls-mode ()
|
|
|
|
"Start `magit-gh-pulls-mode' only after a manual request."
|
|
|
|
(interactive)
|
|
|
|
(magit-gh-pulls-mode)
|
2015-10-22 12:47:54 +00:00
|
|
|
(magit-gh-pulls-popup))
|
2015-08-25 19:05:06 +00:00
|
|
|
|
2015-10-22 12:47:54 +00:00
|
|
|
(define-key magit-mode-map "#" 'spacemacs/load-gh-pulls-mode))
|
2015-08-25 19:05:06 +00:00
|
|
|
:config
|
|
|
|
(spacemacs|diminish magit-gh-pulls-mode "Github-PR")))))
|