diff options
-rw-r--r-- | init.el | 30 |
1 files changed, 19 insertions, 11 deletions
@@ -2092,7 +2092,6 @@ (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) @@ -2361,7 +2360,9 @@ :custom ((inferior-haskell-find-project-root t) (haskell-check-remember-last-command-p nil) + (haskell-completing-read-function 'completing-read) (haskell-font-lock-symbols nil) + (haskell-hoogle-command "hoogle") (haskell-interactive-popup-errors nil) (haskell-process-auto-import-loaded-modules t) (haskell-process-log t) @@ -2372,9 +2373,9 @@ (haskell-stylish-on-save nil)) :config - (defun jao-haskell-hoogle (query) - (interactive (hoogle-prompt)) - (haskell-hoogle query t)) + (defun jao-haskell-hoogle (no-info) + (interactive "P") + (haskell-hoogle (format "%s" (haskell-ident-at-point)) (not no-info))) (put 'haskell-process-args-cabal-repl 'safe-local-variable @@ -2385,13 +2386,18 @@ haskell-doc-mode haskell-decl-scan-mode haskell-indentation-mode - haskell-auto-insert-module-template)) + flymake-mode + (lambda () (eldoc-mode -1)))) (add-hook 'haskell-mode-hook h)) + (add-hook 'haskell-presentation-mode-hook (lambda () (whitespace-mode -1))) + :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)))) + ("C-c h" . haskell-hoogle) + ("C-c C-c" . haskell-compile) + ("C-c C-e" . haskell-command-insert-language-pragma) + ("<f3>" . haskell-session-kill)))) (require 'haskell) @@ -2400,6 +2406,8 @@ (diminish haskell-decl-scan-mode) (jao-define-attached-buffer "\\*hoogle\\*.*") +(jao-define-attached-buffer '(major-mode . haskell-interactive-mode) 0.33) +(jao-define-attached-buffer '(major-mode . haskell-presentation-mode) 0.25) ;; needs cabal install apply-refact (use-package hlint-refactor @@ -2416,11 +2424,11 @@ ("is" "Sort imports" haskell-sort-imports) ("ia" "Align imports" haskell-align-imports)] ["Code" - ("c" "Compile" haskell-compile) - ("s" "stylish on buffer" haskell-mode-stylish-buffer)] - ["Hoogle" + ("c" "haskell check (hlint)" haskell-check) + ("l" "insert language pragma" haskell-command-insert-language-pragma)] + ["Help" ("h" "Hoogle" jao-haskell-hoogle) - ("H" "Hoogle from local server" haskell-hoogle-lookup-from-local)]) + ("TAB" "show info" haskell-process-do-info)]) ;;;; Pie (jao-load-path "pie") |