diff options
author | jao <jao@gnu.org> | 2021-04-15 16:21:12 +0100 |
---|---|---|
committer | jao <jao@gnu.org> | 2021-04-15 16:21:12 +0100 |
commit | 3431da6fb97c7e785d779d4695d53e996b7b978b (patch) | |
tree | 301c61144ebf6380f0e4635707133878ac21de9d | |
parent | ea0c8ed1459ecc4c996f7b03863fd7ae097987ed (diff) | |
download | elibs-3431da6fb97c7e785d779d4695d53e996b7b978b.tar.gz elibs-3431da6fb97c7e785d779d4695d53e996b7b978b.tar.bz2 |
more tweaks for a lspless haskell experience
-rw-r--r-- | completion.org | 2 | ||||
-rw-r--r-- | init.org | 93 |
2 files changed, 63 insertions, 32 deletions
diff --git a/completion.org b/completion.org index 6a62778..600243e 100644 --- a/completion.org +++ b/completion.org @@ -10,10 +10,12 @@ emacs-lisp-mode eshell-mode haskell-mode + haskell-interactive-mode idris-mode lisp-interaction-mode message-mode org-mode + pie-mode scheme-mode)) (company-idle-delay 0.15) (company-lighter "") @@ -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 |