Add tools/gist
This commit is contained in:
parent
eb8759041f
commit
e12ee964ca
7 changed files with 76 additions and 6 deletions
11
TODO.org
11
TODO.org
|
@ -5,9 +5,8 @@
|
||||||
+ [-] Work-in-progress
|
+ [-] Work-in-progress
|
||||||
+ [X] Complete
|
+ [X] Complete
|
||||||
|
|
||||||
** Unreleased [54/129]
|
** Unreleased [55/130]
|
||||||
+ [2/13] Potential plugins
|
+ [2/12] Potential plugins
|
||||||
+ [ ] [[https://github.com/etu/webpaste.el][webpaste.el]]: sending text to bin servies (like gist, ix.io, sprunge, etc.)
|
|
||||||
+ [ ] [[https://github.com/emacs-lsp/lsp-mode][lsp-mode]]: client for MS Language Server Protocol, keep an eye on this
|
+ [ ] [[https://github.com/emacs-lsp/lsp-mode][lsp-mode]]: client for MS Language Server Protocol, keep an eye on this
|
||||||
+ [ ] lang/javascript: [[https://github.com/codesuki/add-node-modules-path][add-node-modules-path]] (adds node_modules to ~exec-path~)
|
+ [ ] lang/javascript: [[https://github.com/codesuki/add-node-modules-path][add-node-modules-path]] (adds node_modules to ~exec-path~)
|
||||||
+ [ ] lang/org: [[https://github.com/Malabarba/latex-extra][orgit]] (org links to magit buffers)
|
+ [ ] lang/org: [[https://github.com/Malabarba/latex-extra][orgit]] (org links to magit buffers)
|
||||||
|
@ -26,11 +25,12 @@
|
||||||
+ [ ] app/irc
|
+ [ ] app/irc
|
||||||
+ [-] app/crm
|
+ [-] app/crm
|
||||||
+ [-] app/write
|
+ [-] app/write
|
||||||
+ [5/57] Add README.org's (with working babel blocks?) to modules (see [[modules/lang/go/README.org][lang/go/README.org]]) to replace bootstaps
|
+ [5/58] Add README.org's (with working babel blocks?) to modules (see [[modules/lang/go/README.org][lang/go/README.org]]) to replace bootstaps
|
||||||
+ [0/8] :tools
|
+ [0/9] :tools
|
||||||
+ [ ] dired
|
+ [ ] dired
|
||||||
+ [ ] electric-indent
|
+ [ ] electric-indent
|
||||||
+ [ ] eshell
|
+ [ ] eshell
|
||||||
|
+ [ ] gist
|
||||||
+ [ ] macos
|
+ [ ] macos
|
||||||
+ [ ] rotate-text
|
+ [ ] rotate-text
|
||||||
+ [ ] term
|
+ [ ] term
|
||||||
|
@ -98,6 +98,7 @@
|
||||||
+ [ ] Update screenshots
|
+ [ ] Update screenshots
|
||||||
+ [ ] tools/upload: add ~+upload/open-remote-file~ command to open current file on the remote (with TRAMP)
|
+ [ ] tools/upload: add ~+upload/open-remote-file~ command to open current file on the remote (with TRAMP)
|
||||||
+ [ ] Fix ~0/0~ displaying in modeline (caused by leftover anzu state)
|
+ [ ] Fix ~0/0~ displaying in modeline (caused by leftover anzu state)
|
||||||
|
+ [X] Add tools/gist (gist.el)
|
||||||
+ [X] Fix ~show-paren-mode~ overlays conflicting with org-indent (causes flickering)
|
+ [X] Fix ~show-paren-mode~ overlays conflicting with org-indent (causes flickering)
|
||||||
+ [X] Fix ~M-z~, ~C-u~ and ~C-w~ in ~org-store-link~ & ~org-insert-link~ prompts
|
+ [X] Fix ~M-z~, ~C-u~ and ~C-w~ in ~org-store-link~ & ~org-insert-link~ prompts
|
||||||
Should undo, delete-line, and delete-word, respectively. Instead, they fall
|
Should undo, delete-line, and delete-word, respectively. Instead, they fall
|
||||||
|
|
|
@ -56,9 +56,10 @@
|
||||||
hl-todo ; highlight TODO/FIXME/NOTE tags
|
hl-todo ; highlight TODO/FIXME/NOTE tags
|
||||||
|
|
||||||
:tools
|
:tools
|
||||||
|
dired ; making dired pretty [functional]
|
||||||
electric-indent ; smarter, keyword-based electric-indent
|
electric-indent ; smarter, keyword-based electric-indent
|
||||||
eshell ; a consistent, cross-platform shell (WIP)
|
eshell ; a consistent, cross-platform shell (WIP)
|
||||||
dired ; making dired pretty [functional]
|
gist ; manage & create gists
|
||||||
macos ; macos-specific commands
|
macos ; macos-specific commands
|
||||||
rotate-text ; cycle region at point between text candidates
|
rotate-text ; cycle region at point between text candidates
|
||||||
tmux ; an API for interacting with tmux
|
tmux ; an API for interacting with tmux
|
||||||
|
|
|
@ -30,6 +30,8 @@
|
||||||
(ex! "x" '+doom:scratch-buffer)
|
(ex! "x" '+doom:scratch-buffer)
|
||||||
|
|
||||||
;; GIT
|
;; GIT
|
||||||
|
(ex! "gist" '+gist:send) ; send current buffer/region to gist
|
||||||
|
(ex! "gistl" '+gist:list) ; list gists by user
|
||||||
(ex! "gbrowse" '+vcs/git-browse) ; show file in github/gitlab
|
(ex! "gbrowse" '+vcs/git-browse) ; show file in github/gitlab
|
||||||
(ex! "gissues" '+vcs/git-browse-issues) ; show github issues
|
(ex! "gissues" '+vcs/git-browse-issues) ; show github issues
|
||||||
(ex! "git" 'magit-status) ; open magit status window
|
(ex! "git" 'magit-status) ; open magit status window
|
||||||
|
|
16
modules/tools/gist/autoload/evil.el
Normal file
16
modules/tools/gist/autoload/evil.el
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
;;; tools/gist/autoload/evil.el
|
||||||
|
|
||||||
|
;;;###autoload (autoload '+gist:send "tools/gist/autoload/evil" nil t)
|
||||||
|
(evil-define-operator +gist:send (beg end search bang)
|
||||||
|
:type inclusive :repeat nil
|
||||||
|
(interactive "<r><!>")
|
||||||
|
(if bang
|
||||||
|
(gist-region-or-buffer-private)
|
||||||
|
(gist-region-or-buffer)))
|
||||||
|
|
||||||
|
;;;###autoload (autoload '+gist:list "tools/gist/autoload/evil" nil t)
|
||||||
|
(evil-define-command +gist:list (&optional username)
|
||||||
|
(interactive "<a>")
|
||||||
|
(if username
|
||||||
|
(gist-list-user username)
|
||||||
|
(gist-list)))
|
13
modules/tools/gist/autoload/gist.el
Normal file
13
modules/tools/gist/autoload/gist.el
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
;;; tools/gist/autoload/gist.el
|
||||||
|
|
||||||
|
;;;###autoload
|
||||||
|
(defun +gist/open-current ()
|
||||||
|
(interactive)
|
||||||
|
(gist-fetch-current)
|
||||||
|
(doom/popup-close-all))
|
||||||
|
|
||||||
|
;;;###autoload
|
||||||
|
(defun +gist/kill-cache ()
|
||||||
|
(interactive)
|
||||||
|
(delete-directory (expand-file-name "gh" pcache-directory) t)
|
||||||
|
(message "gist.el cache cleared"))
|
33
modules/tools/gist/config.el
Normal file
33
modules/tools/gist/config.el
Normal 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)))
|
4
modules/tools/gist/packages.el
Normal file
4
modules/tools/gist/packages.el
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
;; -*- no-byte-compile: t; -*-
|
||||||
|
;;; tools/gist/packages.el
|
||||||
|
|
||||||
|
(package! gist)
|
Loading…
Add table
Add a link
Reference in a new issue