Reorganize modules

This commit is contained in:
Henrik Lissner 2017-01-16 23:19:10 -05:00
parent 50ea98319f
commit f453b3cee1
55 changed files with 0 additions and 1535 deletions

43
modules/apps/db/config.el Normal file
View file

@ -0,0 +1,43 @@
;;; custom-db.el
(use-package sql-mode
:mode "\\.sql$"
:config
(def-popup! "\\*SQL.*\\*" :align below :size 0.4 :noselect t :regexp t)
(evil-set-initial-state 'sql-interactive-mode 'emacs)
(push 'sql-interactive-mode doom-popup-protect-modes)
;; For my local development environment
(setq sql-pop-to-buffer-after-send-region nil
sql-server "docker.dev"
sql-user "root"
sql-password ""))
;; extract these
(evil-define-command doom:db-select (product)
(interactive "<a>")
(sql-set-product (intern product))
(message "sql-product set to %s" product))
(evil-define-operator doom:db (beg end &optional bang product)
"Open a db connection, reopen an old one, or send the selected region to the
open comint."
:type inclusive
(interactive "<r><!><a>")
(let ((sql-buf (get-buffer sql-buffer)))
(when (and bang sql-buf)
(message "Restarting connection")
(kill-buffer sql-buf))
(if sql-buf
(if (or (get-buffer-window sql-buf)
(evil-visual-state-p))
(sql-send-region beg end)
(doom/popup-buffer sql-buf))
(let ((product (if product (intern product) sql-product)))
(unless product
(user-error "No SQL product is set"))
(sql-set-product product)
(sql-product-interactive product 0)
(message "Started new %s connection" product)))))
(provide 'custom-db)
;;; custom-db.el ends here

View file

@ -0,0 +1,53 @@
;;; custom-demo.el --- -*- no-byte-compile: t; -*-
;; This library offers:
;; + impatient-mode: for broadcasting my emacs session
;; + big-mode: for enlarged text while screencasting
;; + TODO integration with reveal.js for presentations
;; + TODO peer programming collab
;; Big-mode settings
(defconst big-mode-font (font-spec :family "Fira Mono" :size 14))
(defconst big-mode-line-spacing 0)
(defconst big-mode-modeline-height 35)
;;
(use-package impatient-mode
:commands impatient-mode
:config (httpd-start))
(defvar big-mode--old-line-spacing line-spacing)
(defvar big-mode--old-modeline-height doom-modeline-height)
(define-minor-mode big-mode
:init-value nil
:lighter " BIG"
:global t
(when big-mode-font
(doom/load-font (if big-mode big-mode-font doom-ui-font)))
(if big-mode
(setq-default
doom-modeline-height big-mode-modeline-height
line-spacing big-mode-line-spacing)
(setq-default
doom-modeline-height big-mode--old-modeline-height
line-spacing big-mode--old-line-spacing)))
(evil-define-command doom:big (&optional size)
"Use to enable large text mode."
(interactive "<a>")
(if size
(let ((big-mode-font big-mode-font))
(big-mode -1)
(font-put big-mode-font :size (string-to-int size))
(big-mode +1))
(big-mode (if big-mode -1 +1))))
(defun doom/resize-for-stream ()
"Resize the frame pixelwise, so that it fits directly into my livecoding.tv
streaming layout."
(interactive)
(set-frame-width (selected-frame) 1325 nil t)
(set-frame-height (selected-frame) 1080 nil t))
(provide 'custom-demo)
;;; custom-demo.el ends here

View file

@ -0,0 +1,62 @@
;; custom-write.el --- FIXME
;; This library offers the following:
;; + Write-mode: a mode that turns Emacs into an app for writing notes,
;; papers, or fiction: it adds eye-candy to org-mode, switches to a light
;; color theme and to a more readable font.
;; + Bibtex integration
;; Write-mode settings
(defconst write-mode-font (font-spec :family "Source Sans Pro" :size 14))
(defconst write-mode--last-mode-line mode-line-format)
(defconst write-mode--last-theme doom-ui-theme)
(defconst write-mode--last-line-spacing line-spacing)
(defun doom-write-mode-line (&optional id)
`(:eval
(let* ((active (eq (selected-window) mode-line-selected-window))
(lhs (list (propertize " "
'display
(pl/percent-xpm doom-modeline-height 100 0 100 0 3
(face-attribute (if active 'doom-modeline-bar 'doom-modeline-inactive-bar) :background nil t)
nil))
(*flycheck)
(*macro-recording)
(*selection-info)
(*anzu)
(*evil-substitute)
(*iedit)
" "
,(if (eq id 'scratch)
'(*buffer-pwd)
'(list (*buffer-path) (*buffer-name) " "))
(*buffer-state)))
(rhs (list (*buffer-encoding-abbrev) " "
(*vc) " "
(*major-mode) " "
(*buffer-position)))
(middle (propertize
" " 'display `((space :align-to (- (+ right right-fringe right-margin)
,(1+ (string-width (format-mode-line rhs)))))))))
(list lhs middle rhs))))
(defvar write-mode nil)
(defun doom/write-mode ()
"A mode that turns Emacs into an app for writing notes, papers, or fiction: it
adds eye-candy to org-mode, switches to a light color theme and to a more
readable font."
(interactive)
(setq write-mode (not write-mode))
(when write-mode-font
(doom/load-font (if write-mode write-mode-font doom-ui-font)))
(mapc (lambda (b)
(with-current-buffer b
(setq line-spacing (if write-mode write-mode--last-line-spacing '2))
(when (featurep 'spaceline)
(let ((doom-hide-mode-line-format '("%e" (:eval (spaceline-ml-write)))))
(doom-hide-mode-line-mode (if write-mode +1 -1))))))
(doom/get-buffers-in-modes '(org-mode markdown-mode))))
(provide 'custom-write)
;;; custom-write.el ends here