diff --git a/modules/module-demo.el b/modules/module-demo.el new file mode 100644 index 000000000..553a85a3b --- /dev/null +++ b/modules/module-demo.el @@ -0,0 +1,29 @@ +;;; module-demo.el --- for collaboration and demonstrations + +;; This library offers: +;; + impatient-mode: for broadcasting my emacs session +;; + TODO integration with reveal.js for presentations +;; + TODO "big-mode", for making emacs presentable for screencasts/share +;; + TODO quick note/time keeping for live/youtube recordings + +(use-package impatient-mode + :defer t + :commands httpd-start) + +(use-package puml-mode + :mode "\\.p\\(lant\\)?uml$" + :init + (setq puml-plantuml-jar-path "/usr/local/Cellar/plantuml/8029/plantuml.8029.jar")) + +;;; + +(defvar big-mode-font narf-default-font) + +(define-minor-mode big-mode + :init-value nil + :lighter " BIG" + :global t + (narf/load-font (if big-mode big-mode-font narf-default-font))) + +(provide 'module-demo) +;;; module-demo.el ends here diff --git a/modules/module-tmux.el b/modules/module-tmux.el new file mode 100644 index 000000000..5bd7f72db --- /dev/null +++ b/modules/module-tmux.el @@ -0,0 +1,70 @@ +;;; module-tmux.el + +;; This library offers: +;; + TODO An integration/abstraction layer to make it seem like tmux and emacs are one +;; program. +;; + TODO A way to manage tmux sessions and layouts from emacs; possibly trigger them +;; depending on current project. + +;;;###autoload +(defun tmux (command &optional modes) + (let ((format + (concat "tmux send-keys " + (if (or (eq modes t) + (eq modes 'clear) + (memq 'clear modes)) + "C-u " "") + "%s" + (if (or (eq modes t) + (eq modes 'run) + (memq 'run modes)) + " Enter" "")))) + (shell-command (format format (shell-quote-argument command))))) + +(evil-define-interactive-code "" + "Ex tmux argument (a mix between and )" + :ex-arg shell + (list (when (evil-ex-p) (evil-ex-file-arg)))) + +;;;###autoload (autoload 'narf:tmux-cd "module-tmux" nil t) +(evil-define-command narf:tmux-cd (&optional bang) + (interactive "") + (if bang + (narf/tmux-cd-to-project) + (narf/tmux-cd-to-here))) + +;;;###autoload (autoload 'narf:tmux "module-tmux" nil t) +(evil-define-operator narf:tmux (&optional command bang) + "Sends input to tmux. Use `bang' to append to tmux" + :type inclusive + :repeat t + (interactive "") + (if (not command) + (os-switch-to-term) + (tmux command bang) + (when (evil-ex-p) + (message "[Tmux] %s" command)))) + +;;;###autoload +(defun narf/tmux-new-window () + (interactive) + (tmux "tmux new-window" t)) + +;;;###autoload +(defun narf/tmux-cd-to-here (&optional dir) + (interactive) + (tmux (format "cd '%s'" (or dir default-directory)))) + +;;;###autoload +(defun narf/tmux-cd-to-project () + (interactive) + (narf/tmux-cd-to-here (narf/project-root))) + +;;;;;;;;;; + +;; TODO +;; (defun narf/window (direction) +;; ) + +(provide 'module-tmux) +;;; module-tmux.el ends here