From d34e74e2bbfb24b1406169874e97c7f34c0b744e Mon Sep 17 00:00:00 2001 From: jao Date: Sun, 2 May 2021 05:08:46 +0100 Subject: haskell tweaks --- init.org | 106 +++++++++++++++++++++++++++++++++++++-------------------------- 1 file changed, 63 insertions(+), 43 deletions(-) diff --git a/init.org b/init.org index 7ff1217..98d9484 100644 --- a/init.org +++ b/init.org @@ -2520,50 +2520,70 @@ :ensure t) #+end_src *** Haskell - #+begin_src emacs-lisp - (use-package haskell-mode - :ensure t - :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)) +***** packages + #+begin_src emacs-lisp + (use-package haskell-mode + :ensure t + :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) + (haskell-stylish-on-save nil)) - :config - (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-auto-insert-module-template)) - - :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 - (use-package hlint-refactor - :ensure t - :after (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 + :config + (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-decl-scan-mode) + (haskell-mode . haskell-indentation-mode) + (haskell-mode . haskell-auto-insert-module-template)) + + :bind (:map haskell-mode-map + (("C-c C-d" . jao-haskell-hoogle) + ("C-c h" . haskell-hoogle-lookup-from-local) + ("C-c C-c" . haskell-compile))) + :diminish ((interactive-haskell-mode . " λ") + (haskell-doc-mode . "") + (haskell-decl-scan-mode . ""))) + + (require 'haskell) + (jao-define-attached-buffer "\\*hoogle\\*.*") + + ;; needs cabal install apply-refact + (use-package hlint-refactor + :ensure t + :after (haskell-mode) + :diminish "" + :hook (haskell-mode . hlint-refactor-mode)) + #+end_src +***** hydra + #+begin_src emacs-lisp + (major-mode-hydra-define haskell-mode nil + ("Imports" + (("in" haskell-navigate-imports "Navigate imports") + ("if" haskell-mode-format-imports "Format imports") + ("is" haskell-sort-imports "Sort imports") + ("ia" haskell-align-imports "Align imports")) + "Code" + (("c" haskell-compile "Compile") + ("s" haskell-mode-stylish-buffer "stylish on buffer")) + "Hoogle" + (("h" jao-haskell-hoogle "Hoogle") + ("H" haskell-hoogle-lookup-from-local "Hoogle from local server")))) + #+end_src *** Prolog #+BEGIN_SRC emacs-lisp (use-package ediprolog :ensure t) -- cgit v1.2.3