Skip to content

Instantly share code, notes, and snippets.

@oyeb
Created August 1, 2019 05:08
Show Gist options
  • Save oyeb/1704351ad0dd43786b0e89109775d6b8 to your computer and use it in GitHub Desktop.
Save oyeb/1704351ad0dd43786b0e89109775d6b8 to your computer and use it in GitHub Desktop.
Suggested emacs config (with stack)
;; Drop this in your ~/.emacs OR ~/.emacs.d/init.el
(require 'package)
(setq package-enable-at-startup nil)
(add-to-list 'package-archives
'("melpa" . "https://melpa.org/packages/")
'("org" . "https://orgmode.org/elpa/"))
(package-initialize)
;; Bootstrap `use-package'
(unless (package-installed-p 'use-package)
(package-refresh-contents)
(package-install 'use-package))
(setq backup-directory-alist '(("." . "~/.emacs.d/backups"))
backup-by-copying t ; Don't delink hardlinks
version-control t ; Use version numbers on backups
delete-old-versions t ; Automatically delete excess backups
)
(setq inhibit-startup-message t)
(tool-bar-mode nil)
(fset 'yes-or-no-p 'y-or-n-p)
(global-hl-line-mode t)
(use-package exec-path-from-shell
:ensure t
:hook (after-init . (lambda ()
(when (memq window-system '(mac ns x))
(exec-path-from-shell-initialize)))))
(use-package company
:ensure t
:hook (after-init . (lambda () (global-company-mode t)))
:config
(setq company-idle-delay 0)
(setq company-minimum-prefix-length 3))
(use-package company-ghc
:ensure t
:after company
:config
(add-to-list 'company-backends 'company-dabbrev-code)
(add-to-list 'company-backends 'company-ghc))
(use-package rainbow-delimiters
:ensure t
:hook (prog-mode . rainbow-delimiters-mode))
(use-package haskell-mode
:ensure t
:hook ((haskell-mode . haskell-interactive-mode)
(haskell-mode . (lambda ()
(add-to-list 'company-backends 'company-dabbrev-code))))
:config
(setq haskell-process-type 'stack-ghci)
:mode "\\.hs\\'")
(use-package monokai-theme
:ensure t)
(use-package spacemacs-theme
:defer t
:ensure t)
(use-package doom-themes
:defer t
:ensure t)
(use-package doom-modeline
:ensure t
:hook (after-init . doom-modeline-init)
:config (setq find-file-visit-truename t))
(load-theme 'spacemacs-dark t)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment