diff options
Diffstat (limited to 'init.org')
-rw-r--r-- | init.org | 93 |
1 files changed, 61 insertions, 32 deletions
@@ -2742,24 +2742,44 @@ ("C-c c" . jao-compile))) (jao-compilation-setup) #+end_src -***** Flycheck - #+begin_src emacs-lisp - (use-package flycheck - :ensure t - :config - (jao-define-attached-buffer "^\\*Flycheck error.*\\*\\'") - :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 #'next-error-buffer-on-selected-frame next-error-verbose t) #+end_src +*** Flycheck/make + #+begin_src emacs-lisp + (use-package flycheck + :disabled t + :ensure t + :config + (jao-define-attached-buffer "^\\*Flycheck error.*\\*\\'") + :custom ((flycheck-mode-line-prefix "ϕ") + (flycheck-keymap-prefix (kbd "s-f"))) + :hook (prog-mode . flycheck-mode)) + + (use-package flymake + :ensure t + :custom ((flymake-mode-line-format '(" " flymake-mode-line-counters))) + :hook ((haskell-mode . flymake-mode)) + :config (jao-define-attached-buffer "^\\*Flymake diagnostics .*\\*\\'") + :bind (:map flymake-mode-map (("s-f n" . flymake-goto-next-error) + ("s-f p" . flymake-goto-prev-error) + ("s-f i" . flymake-show-diagnostic) + ("s-f f" . flymake-show-diagnostics-buffer) + ("s-f l" . consult-flymake)))) + + #+end_src *** Language servers - #+begin_src emacs-lisp :load no + #+begin_src emacs-lisp + (use-package eglot + :ensure t + :hook ((erlang-mode . eglot) + (elixir-mode . eglot))) + + (jao-define-attached-buffer "\\*eldoc\\( .*\\)?\\*" 0.33) + (use-package yasnippet :ensure t :hook ((erlang-mode . yas-minor-mode-on) @@ -2767,19 +2787,21 @@ :diminish ((yas-minor-mode . ""))) (use-package lsp-mode + :disabled t :ensure t :commands (lsp lsp-deferred) :custom (lsp-auto-guess-root t) - :config (use-package lsp-haskell :ensure t) - :hook (;; (haskell-mode . lsp) + :config + (jao-define-attached-buffer "\\*lsp-help\\*" 33) + :hook ((haskell-mode . lsp) (elixir-mode . lsp) (erlang-mode . lsp)) - :diminish " †") + :diminish " 𝛌") - (jao-define-attached-buffer "\\*lsp-help\\*" 33) - (jao-define-attached-buffer "\\*eldoc\\( .*\\)?\\*" 0.33) + (use-package lsp-haskell :ensure t) (use-package dante + :disabled t :ensure t :after haskell-mode :commands 'dante-mode @@ -3135,27 +3157,35 @@ #+begin_src emacs-lisp (use-package haskell-mode :ensure t - :init - (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-log t - haskell-process-suggest-remove-import-lines t - haskell-process-type 'cabal-repl) + :custom + ((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-log t) + (haskell-process-suggest-remove-import-lines t) + (haskell-process-suggest-hoogle-imports t) + (haskell-process-type 'cabal-repl) + (haskell-process-use-presentation-mode t)) :config - (add-hook 'haskell-mode-hook - (lambda () - (set (make-local-variable 'compile-command) "cabal install"))) + (require 'haskell-process) + (require 'haskell-hoogle) + + (defun jao-haskell-hoogle (query) + (interactive (hoogle-prompt)) + (haskell-hoogle query t)) :hook ((haskell-mode . interactive-haskell-mode) (haskell-mode . haskell-doc-mode) - (haskell-mode . haskell-indentation-mode)) + (haskell-mode . haskell-indentation-mode) + (haskell-mode . haskell-auto-insert-module-template)) - :bind (:map haskell-mode-map ("C-c h" . haskell-hoogle)) - :diminish ((interactive-haskell-mode . "^") + :bind (:map haskell-mode-map + (("C-c C-d" . jao-haskell-hoogle) + ("C-c h" . haskell-hoogle-lookup-from-local))) + :diminish ((interactive-haskell-mode . " λ") (haskell-doc-mode . ""))) ;; needs cabal install apply-refact @@ -3167,7 +3197,6 @@ ("r" . hlint-refactor-refactor-at-point) ("R" . hlint-refactor-refactor-buffer)) :hook (haskell-mode . hlint-refactor-mode)) - #+end_src *** Prolog #+BEGIN_SRC emacs-lisp |