Add tools/gist

This commit is contained in:
Henrik Lissner 2017-05-07 15:10:46 +02:00
parent eb8759041f
commit e12ee964ca
7 changed files with 76 additions and 6 deletions

View file

@ -0,0 +1,33 @@
;;; tools/gist/config.el
;; NOTE On occasion, the cache gets corrupted, causing wrong-type-argument
;; errors. If that happens, try `+gist/kill-cache'. You may have to restart
;; Emacs.
(def-package! gist
:commands (gist-list gist-region-or-buffer-private gist-region-or-buffer)
:init
(add-hook 'gist-mode-hook #'doom-buffer-mode)
:config
(set! :popup "*github:gists*" :size 15 :select t :autokill t)
;; evil-ify gist listing
(set! :evil-state 'gist-list-mode 'normal)
(map! :map gist-list-menu-mode-map
:n "RET" '+gist/open-current
:n "d" 'gist-kill-current
:n "r" 'gist-list-reload
:n "c" 'gist-add-buffer
:n "y" 'gist-print-current-url
:n "b" 'gist-browse-current-url
:n "s" 'gist-star
:n "S" 'gist-unstar
:n "f" 'gist-fork
:n "q" 'quit-window)
(when (bound-and-true-p shackle-mode)
(defun +gist*list-render (orig-fn &rest args)
(funcall orig-fn (car args) t)
(unless (cadr args)
(doom-popup-buffer (current-buffer))))
(advice-add #'gist-list-render :around #'+gist*list-render)))