summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--init.org115
1 files changed, 54 insertions, 61 deletions
diff --git a/init.org b/init.org
index 64c6f0b..e944232 100644
--- a/init.org
+++ b/init.org
@@ -2753,13 +2753,15 @@
(jao-compilation-setup)
#+end_src
***** Flycheck
- #+BEGIN_SRC emacs-lisp
+ #+begin_src emacs-lisp
(use-package flycheck
:ensure t
- :init
+ :config
(jao-define-attached-buffer "^\\*Flycheck error.*\\*\\'")
- (setq flycheck-mode-line-prefix ""))
- #+END_SRC
+ :custom ((flycheck-mode-line-prefix "ϕ")
+ (flycheck-keymap-prefix (kbd "s-f")))
+ :hook (haskell-mode . flycheck-mode))
+ #+end_src
***** Next error
#+begin_src emacs-lisp
(setq next-error-find-buffer-function
@@ -2767,31 +2769,35 @@
next-error-verbose t)
#+end_src
*** Language servers
- #+begin_src emacs-lisp
- (use-package eglot
- :ensure t)
-
+ #+begin_src emacs-lisp :load no
(use-package yasnippet
:ensure t
+ :hook ((erlang-mode . yas-minor-mode-on)
+ (erlixir-mode . yas-minor-mode-on))
:diminish ((yas-minor-mode . "")))
- (use-package flymake :diminish)
-
- ;; (jao-define-attached-buffer "\\*eldoc\\( .*\\)?\\*" 0.33)
-
- ;; (use-package lsp-mode
- ;; :commands (lsp lsp-deferred)
- ;; :custom (lsp-auto-guess-root t)
- ;; :ensure t
- ;; :diminish " †")
-
- ;; (jao-define-attached-buffer "\\*lsp-help\\*" 33)
+ (use-package lsp-mode
+ :ensure t
+ :commands (lsp lsp-deferred)
+ :custom (lsp-auto-guess-root t)
+ :config (use-package lsp-haskell :ensure t)
+ :hook (;; (haskell-mode . lsp)
+ (elixir-mode . lsp)
+ (erlang-mode . lsp))
+ :diminish " †")
- ;; (use-package company-lsp
- ;; :ensure t
- ;; :commands company-lsp)
+ (jao-define-attached-buffer "\\*lsp-help\\*" 33)
+ (jao-define-attached-buffer "\\*eldoc\\( .*\\)?\\*" 0.33)
- #+end_src
+ (use-package dante
+ :ensure t
+ :after haskell-mode
+ :commands 'dante-mode
+ :config
+ (flycheck-add-next-checker 'haskell-dante '(info . haskell-hlint))
+ (setq dante-methods '(new-build bare-cabal))
+ :hook ((haskell-mode . dante-mode)))
+ #+end_src
*** JSON
#+BEGIN_SRC emacs-lisp
(use-package json-mode :ensure t)
@@ -2944,12 +2950,7 @@
(setq erlang-shell-function #'jao-vterm-repl
erlang-shell-display-function #'jao-vterm-repl-pop-to-repl
- erlang-compile-function #'jao-erlang-compile)
-
- (add-hook 'erlang-mode-hook #'yas-minor-mode-on)
- (add-hook 'erlang-mode-hook #'eglot-ensure)
- ;; (add-hook 'erlang-mode-hook #'lsp)
- )
+ erlang-compile-function #'jao-erlang-compile))
#+end_src
*** Idris
#+begin_src emacs-lisp
@@ -2968,11 +2969,7 @@
:ensure t
:custom (lsp-clients-elixir-server-executable
(expand-file-name "~/usr/share/elixir-ls/language_server.sh"))
- :bind (:map elixir-mode-map (("C-c C-z" . jao-vterm-repl-pop-to-repl)))
- :config
- ;; (add-hook 'elixir-mode-hook #'lsp)
- (add-hook 'elixir-mode-hook #'eglot-ensure)
- (add-hook 'elixir-mode-hook #'yas-minor-mode))
+ :bind (:map elixir-mode-map (("C-c C-z" . jao-vterm-repl-pop-to-repl))))
(use-package mix
:ensure t
@@ -3144,47 +3141,43 @@
:ensure t)
#+end_src
*** Haskell
- #+BEGIN_SRC emacs-lisp
+ #+begin_src emacs-lisp
(use-package haskell-mode
:ensure t
:init
- (setq inferior-haskell-find-project-root t)
- (setq haskell-check-remember-last-command-p nil)
- (setq haskell-program-name "ghci")
- (setq haskell-font-lock-symbols nil)
- (setq haskell-process-suggest-remove-import-lines t
+ (setq inferior-haskell-find-project-root t
+ haskell-check-remember-last-command-p nil
+ haskell-font-lock-symbols nil
+ haskell-interactive-popup-errors nil
haskell-process-auto-import-loaded-modules t
- haskell-process-type 'cabal-repl
- haskell-process-log t)
+ haskell-process-log t
+ haskell-process-suggest-remove-import-lines t
+ haskell-process-type 'cabal-repl)
:config
(add-hook 'haskell-mode-hook
(lambda ()
(set (make-local-variable 'compile-command) "cabal install")))
- (require 'haskell-interactive-mode)
- (require 'haskell-process)
-
- :hook (;; (haskell-mode . interactive-haskell-mode)
+ :hook ((haskell-mode . interactive-haskell-mode)
(haskell-mode . haskell-doc-mode)
- (haskell-mode . haskell-indentation-mode)
- (haskell-mode . flycheck-mode))
-
- :bind (:map haskell-mode-map
- ("C-c h" . haskell-hoogle)))
+ (haskell-mode . haskell-indentation-mode))
- ;; (use-package hlint-refactor
- ;; :ensure t
- ;; :diminish " |"
- ;; :config (add-hook 'haskell-mode-hook 'hlint-refactor-mode))
+ :bind (:map haskell-mode-map ("C-c h" . haskell-hoogle))
+ :diminish ((interactive-haskell-mode . "^")
+ (haskell-doc-mode . "")))
- (use-package dante
+ ;; needs cabal install apply-refact
+ (use-package hlint-refactor
:ensure t
- :after haskell-mode
- :commands 'dante-mode
- :config (setq dante-methods '(new-build bare-cabal))
- :hook ((haskell-mode . dante-mode)))
- #+END_SRC
+ :after (flycheck haskell-mode)
+ :diminish ""
+ :bind (:map flycheck-command-map
+ ("r" . hlint-refactor-refactor-at-point)
+ ("R" . hlint-refactor-refactor-buffer))
+ :hook (haskell-mode . hlint-refactor-mode))
+
+ #+end_src
*** Prolog
#+BEGIN_SRC emacs-lisp
(use-package ediprolog :ensure t)