Skip to content

Instantly share code, notes, and snippets.

@Cmdv
Created November 8, 2020 16:12
Show Gist options
  • Save Cmdv/70d00515a1b9a7def257ee89344120c4 to your computer and use it in GitHub Desktop.
Save Cmdv/70d00515a1b9a7def257ee89344120c4 to your computer and use it in GitHub Desktop.
Emacs HLS setup
;;; $DOOMDIR/config.el -*- lexical-binding: t; -*-
;; Place your private configuration here! Remember, you do not need to run 'doom
;; sync' after modifying this file!
;; Some functionality uses this to identify you, e.g. GPG configuration, email
;; clients, file templates and snippets.
(setq user-full-name "John Doe"
user-mail-address "[email protected]")
;; Doom exposes five (optional) variables for controlling fonts in Doom. Here
;; are the three important ones:
;;
;; + `doom-font'
;; + `doom-variable-pitch-font'
;; + `doom-big-font' -- used for `doom-big-font-mode'; use this for
;; presentations or streaming.
;;
;; They all accept either a font-spec, font string ("Input Mono-12"), or xlfd
;; font string. You generally only need these two:
(setq doom-font (font-spec :family "monospace" :size 14))
;; There are two ways to load a theme. Both assume the theme is installed and
;; available. You can either set `doom-theme' or manually load a theme with the
;; `load-theme' function. This is the default:
(setq doom-theme 'doom-one)
;; If you use `org' and don't want your org files in the default location below,
;; change `org-directory'. It must be set before org loads!
(setq org-directory "~/org/")
;;;;;;;;;;;;
;; direnv ;;
;;;;;;;;;;;;
(add-hook 'before-hack-local-variables-hook #'direnv-update-environment)
;; Autocompletion(company)
(setq company-idle-delay 0.5
company-minimum-prefix-length 2
;; company-show-numbers t
)
;; lsp-ui
(after! lsp-ui
(setq lsp-ui-doc-enable t
lsp-ui-doc-glance 1
lsp-ui-doc-delay 0.5
lsp-ui-doc-include-signature t
lsp-ui-doc-position 'Top
lsp-ui-doc-border "#fdf5b1"
lsp-ui-doc-max-width 65
lsp-ui-doc-max-height 70
lsp-ui-sideline-enable t
lsp-ui-sideline-ignore-duplicate t
lsp-ui-peek-enable t
lsp-ui-flycheck-enable -1)
(add-to-list 'lsp-ui-doc-frame-parameters '(left-fringe . 0))
)
;;;;;;;;;;;;;
;; haskell ;;
;;;;;;;;;;;;;
(map! :leader
(:after lsp-mode
(:prefix ("l" . "LSP")
:desc "Restart LSP server" "r" #'lsp-workspace-restart
:desc "Excute code action" "a" #'lsp-execute-code-action
:desc "Go to definition" "d" #'lsp-find-definition
:desc "Toggle doc mode" "d" #'lsp-ui-doc-mode
(:prefix ("u" . "LSP UI")
:desc "Toggle doc mode" "d" #'lsp-ui-doc-mode
:desc "Toggle sideline mode" "s" #'lsp-ui-sideline-mode
:desc "Glance at doc" "g" #'lsp-ui-doc-glance
:desc "Toggle imenu" "i" #'lsp-ui-imenu
)
)))
;; (use-package lsp-haskell
;; :ensure t
;; :config
;; (setq lsp-haskell-process-path-hie "haskell-language-server-wrapper")
;; (setq lsp-haskell-process-args-hie '("-d"))
;; ;; Comment/uncomment this line to see interactions between lsp client/server.
;; ;; (setq lsp-log-io t)
;; )
;; (after! lsp-haskell
;; (setq lsp-haskell-process-path-hie "haskell-language-server-wrapper")
;; )
;; (after! flycheck
;; (pushnew! flycheck-disabled-checkers 'haskell-ghc 'haskell-stack-ghc))
;; ;; (after! lsp-haskell
;; (setq warning-minimum-level ':error) ; This is temporary for a bug in lsp-ui that pops up errors
;; (lsp-haskell-set-hlint-on)
;; (lsp-haskell-set-liquid-on)
;; )
;; (after! flycheck
;; (pushnew! flycheck-disabled-checkers 'haskell-ghc 'haskell-stack-ghc))
;; (setq haskell-interactive-popup-errors nil)
;; (use-package ormolu
;; :hook (haskell-mode . ormolu-format-on-save-mode)
;; :bind
;; (:map haskell-mode-map
;; ("C-c r" . ormolu-format-buffer)
;; )
;; )
;;;;;;;;;;;;;;;;
;; PureScript ;;
;;;;;;;;;;;;;;;;
(use-package! psc-ide
:hook (purescript-mode . psc-ide-mode)
:config
(remove-hook 'company-backends 'company-psc-ide-backend)
(set-company-backend! 'purescript-mode 'company-psc-ide-backend))
;; This determines the style of line numbers in effect. If set to `nil', line
;; numbers are disabled. For relative line numbers, set this to `relative'.
(setq display-line-numbers-type t)
(setq-default show-trailing-whitespace t)
(setq-default indicate-empty-lines t)
;; Here are some additional functions/macros that could help you configure Doom:
;;
;; - `load!' for loading external *.el files relative to this one
;; - `use-package' for configuring packages
;; - `after!' for running code after a package has loaded
;; - `add-load-path!' for adding directories to the `load-path', relative to
;; this file. Emacs searches the `load-path' when you load packages with
;; `require' or `use-package'.
;; - `map!' for binding new keys
;;
;; To get information about any of these functions/macros, move the cursor over
;; the highlighted symbol at press 'K' (non-evil users must press 'C-c g k').
;; This will open documentation for it, including demos of how they are used.
;;
;; You can also try 'gd' (or 'C-c g d') to jump to their definition and see how
;; they are implemented.
@Cmdv
Copy link
Author

Cmdv commented Aug 13, 2021

@Raagh yeah that's how I have it now. But you need to make sure you have purs on your $PATH from memory it struggles when it's only install locally to the project (so try installing purescript globally)! also with doom-emacs I make sure to run doom sync to make sure all my paths are up to date.

@Raagh
Copy link

Raagh commented Aug 14, 2021

Thanks for answering. yeah after installing it globally it works fine. I couldn't make it work locally.

@Cmdv
Copy link
Author

Cmdv commented Aug 14, 2021

cool, glad you got it working 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment