Merge branch 'master' of git.jeremydormitzer.com:jdormit/dotfiles

This commit is contained in:
Jeremy Dormitzer 2019-12-02 19:01:15 -05:00
commit 24566a61c3

View File

@ -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")
@ -1867,6 +1870,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
@ -2892,7 +2912,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)
@ -3543,9 +3564,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)