Add tools/impatient-mode

This commit is contained in:
Henrik Lissner 2017-07-05 02:49:10 +02:00
parent ea4e3e3c77
commit 72557d8c43
No known key found for this signature in database
GPG Key ID: 5F6C0EA160557395
5 changed files with 38 additions and 1 deletions

View File

@ -63,6 +63,7 @@
electric-indent ; smarter, keyword-based electric-indent
eshell ; a consistent, cross-platform shell (WIP)
gist ; interacting with github gists
impatient-mode ; show off code over HTTP
;macos ; MacOS-specific commands
neotree ; a project drawer, like NERDTree for vim
password-store ; password manager for nerds

View File

@ -281,7 +281,7 @@
:desc "Fullscreen" :n "f" #'doom/toggle-fullscreen
:desc "Indent guides" :n "i" #'highlight-indentation-mode
:desc "Indent guides (column)" :n "I" #'highlight-indentation-current-column-mode
:desc "Impatient mode" :n "h" #'+present/impatient-mode
:desc "Impatient mode" :n "h" #'+impatient-mode/toggle
:desc "Big mode" :n "b" #'doom-big-font-mode
:desc "Evil goggles" :n "g" #'+evil-goggles/toggle))

View File

@ -0,0 +1,25 @@
;;; tools/impatient-mode/autoload.el -*- lexical-binding: t; -*-
;;;###autoload
(defun +impatient-mode/toggle ()
"TODO"
(interactive)
(require 'simple-httpd)
(unless (process-status "httpd")
(httpd-start))
(impatient-mode)
(if impatient-mode
(add-hook 'kill-buffer-hook '+impatient-mode--cleanup-impatient-mode)
(+impatient-mode--cleanup-impatient-mode)))
(defun +impatient-mode--cleanup-impatient-mode ()
(unless (cl-loop for buf in (doom-buffer-list)
if (buffer-local-value 'impatient-mode buf)
return t)
(httpd-stop)
(cl-loop for buf in (doom-buffer-list)
if (buffer-local-value 'impatient-mode buf)
do
(with-current-buffer buf
(impatient-mode -1)))
(remove-hook 'kill-buffer-hook '+impatient-mode--cleanup-impatient-mode)))

View File

@ -0,0 +1,6 @@
;;; tools/impatient-mode/config.el -*- lexical-binding: t; -*-
;; Show off code as you write it
(def-package! impatient-mode
:commands impatient-mode)

View File

@ -0,0 +1,5 @@
;; -*- no-byte-compile: t; -*-
;;; tools/impatient-mode/packages.el
(package! htmlize)
(package! impatient-mode)