use poper emacs namespace, move keys to dedicated minor mode

This commit is contained in:
Maciej 2021-03-06 10:52:54 +02:00
parent 7f5f90ae4d
commit 76c7d665c7
Signed by: maciej
GPG key ID: 41D62D42D3B0D765
38 changed files with 337 additions and 221 deletions

View file

@ -1,47 +0,0 @@
;;; languages/elixir -- summary
;;; Commentary:
;;; Code:
(require 'pkg/prog-mode "$HOME/.emacs.d/pkg/prog-mode.el")
(require 'pkg/flycheck "$HOME/.emacs.d/pkg/flycheck.el")
(require 'pkg/hydra "$HOME/.emacs.d/pkg/hydra.el")
(use-package elixir-mode
:requires (lsp-mode lsp-ui)
:ensure t)
(defhydra my-elixir/context-hydra (:color teal :hint nil)
"
^Elixir actions^
^^^^^^^^-----------------------------------------------------------------------
_r_: Reload buffer _f_: Format buffer
_i_: Indent buffer _m_: iMenu
"
("q" nil "cancel" :color blue)
("r" revert-buffer-no-confirm)
("i" indent-region)
("f" elixir-format)
("m" lsp-ui-imenu))
(defun activate-elixir-mode ()
"All things Elixir."
(set-indent 2)
(column-enforce-n 98)
(setq-local flycheck-check-syntax-automatically '(save mode-enabled))
(define-key elixir-mode-map (kbd "<f17>") 'elixir-format)
;; If needed, switch the one below to false to disable documentation pop-ups
;; (setq-local lsp-ui-doc-enable t)
(define-key elixir-mode-map (kbd "C-c l") 'my-elixir/context-hydra/body)
;; Company list override
(add-to-list (make-local-variable 'company-backends)
'(company-capf company-yasnippet)))
(add-hook 'elixir-mode-hook 'activate-elixir-mode)
(provide 'languages/elixir)
;;; elixir.el ends here