diff --git a/init.example.el b/init.example.el index 7d03efd15..c272bcd19 100644 --- a/init.example.el +++ b/init.example.el @@ -75,7 +75,8 @@ ;erlang ; an elegant language for a more civilized age ;elixir ; erlang done right ;elm ; care for a cup of TEA? - emacs-lisp ; drown in parentheses + (emacs-lisp ; drown in parentheses + +parinfer) ; A handy addon to sort of turn lisp into python ;ess ; emacs speaks statistics ;go ; the hipster dialect ;(haskell +intero) ; a language that's lazier than I am diff --git a/modules/lang/emacs-lisp/+parinfer.el b/modules/lang/emacs-lisp/+parinfer.el new file mode 100644 index 000000000..60a6f4d98 --- /dev/null +++ b/modules/lang/emacs-lisp/+parinfer.el @@ -0,0 +1,22 @@ +;;; lang/emacs-lisp/+parinfer.el -*- lexical-binding: t; -*- + + +(def-package! parinfer + :commands (parinfer-mode) + :init + (add-hook! emacs-lisp-mode + (yas-minor-mode -1) + (parinfer-mode)) + (setq parinfer-extensions + '(defaults + pretty-parens + smart-tab + smart-yank)) + (if (featurep! :feature evil) + (push 'evil parinfer-extensions)) + :config + (map! :map emacs-lisp-mode-map + :i "" #'parinfer-smart-tab:dwim-right + :i "" #'parinfer-smart-tab:dwim-left + :localleader + :nv "m" #'parinfer-toggle-mode)) diff --git a/modules/lang/emacs-lisp/config.el b/modules/lang/emacs-lisp/config.el index dc395d0e5..20d7077e1 100644 --- a/modules/lang/emacs-lisp/config.el +++ b/modules/lang/emacs-lisp/config.el @@ -116,3 +116,5 @@ (def-project-mode! +emacs-lisp-ert-mode :modes (emacs-lisp-mode) :match "/test[/-].+\\.el$") + +(when (featurep! +parinfer) (load! "+parinfer")) diff --git a/modules/lang/emacs-lisp/packages.el b/modules/lang/emacs-lisp/packages.el index 24b02c21b..07f484dd9 100644 --- a/modules/lang/emacs-lisp/packages.el +++ b/modules/lang/emacs-lisp/packages.el @@ -9,3 +9,6 @@ (when (featurep! :feature syntax-checker) (package! flycheck-cask)) + +(when (featurep! +parinfer) + (package! parinfer))