 (use-package elixir-mode
   :straight t
   :defer t
-  :config
-  (add-hook 'elixir-mode-hook 'alchemist-mode)
-  (add-hook 'elixir-mode-hook
-            (lambda () (add-hook 'before-save-hook 'elixir-format nil t)))
-  (evil-add-command-properties #'alchemist-goto-defintion-at-point :jump t))
+  :init
+  (defun seanmacs/elixir-format-on-save ()
+    (when (eq major-mode 'elixir-mode)
+      (elixir-format)))
+  :config
+  (evil-add-command-properties #'alchemist-goto-defintion-at-point :jump t)
+  :hook ((elixir-mode . alchemist-mode)
+         (before-save . seanmacs/elixir-format-on-save)))
 
 (use-package alchemist
   :straight t

(use-package go-mode
  :straight t
  :defer t
  :config
  (add-hook 'go-mode-hook #'lsp)
  (add-hook 'before-save-hook #'gofmt-before-save)
  (evil-add-command-properties #'godef-jump :jump t)
  (setq gofmt-command "goimports")
  (setq gofmt-args '("-local=go.coder.com"))
  (define-key go-mode-map (kbd "C-c C-d") #'lsp-describe-thing-at-point))

(core/local 'go-mode-map
            "rn" 'lsp-rename)

  :straight t
  :defer t
  :config
  (setq inferior-lisp-program "sbcl"
        slime-contribs '(slime-fancy)))

(core/local 'lisp-mode-map
            "o" 'slime)
