dkellner-elisp.el 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. ;; dkellner-elisp.el --- ELisp-specific configuration
  2. (add-hook 'emacs-lisp-mode-hook 'eldoc-mode)
  3. (use-package paredit
  4. :config
  5. (add-hook 'emacs-lisp-mode-hook 'paredit-mode)
  6. ;; I'm used to <C-left> and <C-right> for `left-word' and `right-word' so I
  7. ;; find it rather annoying that `paredit-mode' overwrites these with
  8. ;; `paredit-forward-barf-sexp' and `paredit-forward-slurp-sexp'.
  9. (define-key paredit-mode-map (kbd "<C-left>") nil)
  10. (define-key paredit-mode-map (kbd "<C-right>") nil)
  11. :diminish paredit-mode)
  12. (use-package macrostep
  13. :bind (:map emacs-lisp-mode-map
  14. ("C-c e" . macrostep-expand)))
  15. ;; Make the use of sharp-quote more convenient.
  16. ;; See http://endlessparentheses.com/get-in-the-habit-of-using-sharp-quote.html
  17. (defun endless/sharp ()
  18. "Insert #' unless in a string or comment."
  19. (interactive)
  20. (call-interactively #'self-insert-command)
  21. (let ((ppss (syntax-ppss)))
  22. (unless (or (elt ppss 3)
  23. (elt ppss 4)
  24. (eq (char-after) ?'))
  25. (insert "'"))))
  26. (bind-key "#" #'endless/sharp emacs-lisp-mode-map)
  27. (use-package buttercup
  28. :bind (:map emacs-lisp-mode-map
  29. ("C-c C-t" . buttercup-run-at-point)))
  30. (provide 'dkellner-elisp)