From b2b46c04a61694e9cadc86cc85940ca7f4617d3d Mon Sep 17 00:00:00 2001 From: Jeremy Dormitzer Date: Mon, 13 Jan 2020 14:10:13 -0500 Subject: [PATCH] Ensure that :w runs gist-mode-save-buffer in gist-mode buffers --- emacs/init.org | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/emacs/init.org b/emacs/init.org index 028c68d..4039c6e 100755 --- a/emacs/init.org +++ b/emacs/init.org @@ -153,6 +153,14 @@ Make undo not undo paragraphs at a time: (setq evil-want-fine-undo t) #+END_SRC +Add a convenience function for making buffer-local ex-commands: +#+BEGIN_SRC emacs-lisp + (defun evil-ex-define-local-cmd (cmd function) + (set (make-local-variable 'evil-ex-commands) (copy-tree evil-ex-commands)) + (evil-ex-define-cmd cmd function)) +#+END_SRC + + ** evil-collection A collection of evil bindings for various modes #+BEGIN_SRC emacs-lisp @@ -4626,7 +4634,11 @@ Add a function to power the [[https://orgmode.org/worg/org-contrib/alfred-org-ca * gist.el [[https://github.com/defunkt/gist.el][Integrate with GitHub gists]] from Emacs! #+BEGIN_SRC emacs-lisp - (use-package gist) + (use-package gist + :config + (add-hook 'gist-mode-hook + (lambda () + (evil-ex-define-local-cmd "w[rite]" 'gist-mode-save-buffer)))) #+END_SRC * ffap