From 332a091e42f6ce86aac583200dbf186231d55ff0 Mon Sep 17 00:00:00 2001 From: Jeremy Dormitzer Date: Sun, 1 Dec 2019 11:45:22 -0500 Subject: [PATCH 1/4] Add jinja2 to web-mode mode hooks --- emacs/init.org | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/emacs/init.org b/emacs/init.org index 4beeed7..7880d88 100755 --- a/emacs/init.org +++ b/emacs/init.org @@ -1465,8 +1465,11 @@ Some formatting stuff: :mode (("\\.html\\'" . web-mode) ("\\.js\\'" . web-mode) ("\\.jsx\\'" . web-mode) - ("\\.mako\\'" . web-mode)) + ("\\.mako\\'" . web-mode) + ("\\.jinja2\\'" . web-mode)) :config + (setq web-mode-engines-alist + '(("django" . "\\.jinja2\\'"))) (add-hook 'web-mode-hook (lambda () (when (equal web-mode-content-type "javascript") From a6859cb9e8e7544f9a83f8149b23294d0c59350e Mon Sep 17 00:00:00 2001 From: Jeremy Dormitzer Date: Mon, 2 Dec 2019 17:44:30 -0500 Subject: [PATCH 2/4] Add function to format XML efficiently --- emacs/init.org | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/emacs/init.org b/emacs/init.org index 7880d88..8547759 100755 --- a/emacs/init.org +++ b/emacs/init.org @@ -1869,6 +1869,23 @@ Set up hideshow for nXML mode: nxml-forward-element nil)) #+END_SRC + +A function to format XML using tidy or xmllint if available, falling back to sgml-pretty-print: +#+BEGIN_SRC emacs-lisp + (defun xml-pretty-print () + (interactive) + (let ((start (if (region-active-p) (region-beginning) (point-min))) + (end (if (region-active-p) (region-end) (point-max)))) + (cond + ((executable-find "tidy") + (shell-command-on-region start end "tidy -wrap 88 -q -i -xml" nil t)) + ((executable-find "xmllint") + (shell-command-on-region start end "xmllint --format -" nil t)) + (t (sgml-pretty-print start end))))) + + (general-def nxml-mode-map "C-M-\\" #'xml-pretty-print) + +#+END_SRC * CSVs #+BEGIN_SRC emacs-lisp (use-package csv-mode From 3c7864278afd068fef11a561fd861e3234201253 Mon Sep 17 00:00:00 2001 From: Jeremy Dormitzer Date: Mon, 2 Dec 2019 17:44:51 -0500 Subject: [PATCH 3/4] Add keybinding for counsel-yank-pop --- emacs/init.org | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/emacs/init.org b/emacs/init.org index 8547759..1f8d15a 100755 --- a/emacs/init.org +++ b/emacs/init.org @@ -2911,7 +2911,8 @@ An alternative minibuffer completion framework: :general ("M-x" #'counsel-M-x) ("C-x C-f" #'counsel-find-file) - ("C-M-u" #'counsel-unicode-char)) + ("C-M-u" #'counsel-unicode-char) + ("C-c p" #'counsel-yank-pop)) (use-package ivy-hydra :after counsel) From 9abcdaa0f8ec46b6ad0dacca3db1daf8e09c61af Mon Sep 17 00:00:00 2001 From: Jeremy Dormitzer Date: Mon, 2 Dec 2019 17:45:02 -0500 Subject: [PATCH 4/4] Update release-manager command --- emacs/init.org | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/emacs/init.org b/emacs/init.org index 1f8d15a..e17c08b 100755 --- a/emacs/init.org +++ b/emacs/init.org @@ -3563,9 +3563,8 @@ Some functions to make my day job easier. (defun release-manager () (interactive) (run-service-in-eshell "*release-manager*" - "~/lola/gittools" - "./release-manager" - (get-python-setup "gittools"))) + "~/lola/release-manager" + "pipenv run python release-manager")) (jdormit/define-prefix "L" "lola") (leader-def-key "Lr" #'release-manager)