Created
November 30, 2020 17:26
-
-
Save ghais/e7e955c6a0f51182ff3a3c4969dfe090 to your computer and use it in GitHub Desktop.
Emacs config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Required packages. | |
(require 'use-package) | |
(require 'package) | |
(add-to-list 'package-archives | |
'("marmalade" . | |
"http://marmalade-repo.org/packages/")) | |
;; Make file names unique | |
(require 'uniquify) | |
;; Remove splash screen | |
(setq inhibit-splash-screen t) | |
;; Mac key binding | |
(setq mac-command-modifier 'meta) | |
(custom-set-variables | |
;; custom-set-variables was added by Custom. | |
;; If you edit it by hand, you could mess it up, so be careful. | |
;; Your init file should contain only one such instance. | |
;; If there is more than one, they won't work right. | |
'(haskell-font-lock-haddock t) | |
'(haskell-font-lock-symbols t) | |
'(haskell-process-auto-import-loaded-modules t) | |
'(haskell-process-log t) | |
'(haskell-process-suggest-remove-import-lines t) | |
'(haskell-process-type 'stack-ghci) | |
'(package-archives | |
'(("gnu" . "https://elpa.gnu.org/packages/") | |
("melpa" . "https://melpa.org/packages/"))) | |
'(package-selected-packages | |
'(vega-view yaml-mode use-package dante web-mode toml-mode skewer-mode rust-mode php-extras php+-mode multi-web-mode multi mmm-mako markdown-mode json-mode haskell-mode haskell-emacs golint go-play go-mode go-errcheck go-autocomplete flycheck ess-R-data-view cm-mode))) | |
;; Misc | |
(blink-cursor-mode t) ;; Blink cursor | |
(column-number-mode t) ;; Display column numbers | |
(show-paren-mode t) ;; Show matching paren | |
(size-indication-mode t) ;; file size indication. | |
;; Org-mode | |
(add-to-list 'auto-mode-alist '("\\.org$" . org-mode)) | |
(setq org-log-done t) | |
(define-key global-map "\C-cl" 'org-store-link) | |
(define-key global-map "\C-ca" 'org-agenda) | |
;; Markdown mode | |
(autoload 'markdown-mode "markdown-mode.el" | |
"Major mode for editing Markdown files" t) | |
(add-to-list 'auto-mode-alist '("\\.md$" . markdown-mode)) | |
(setq user-mail-address "ghais.issa@gmail.com") ;; set user email address | |
(add-to-list 'exec-path "/usr/local/bin") ;; add to execution list | |
(set-cursor-color "red") ;;to set the cursor color | |
;; support spell correction | |
(setq ispell-program-name "aspell" | |
ispell-dictionary "english" | |
ispell-dictionary-alist | |
(let ((default '("[A-Za-z]" "[^A-Za-z]" "[']" nil | |
("-B" "-d" "english" "--dict-dir" | |
"/Library/Application Support/cocoAspell/aspell6-en-6.0-0") | |
nil iso-8859-1))) | |
`((nil ,@default) | |
("english" ,@default)))) | |
;; Default tabl indition | |
(setq-default indent-tabs-mode nil) | |
(setq delete-auto-save-files t) ; Delete unnecessary | |
; auto-save files. | |
;;Backups | |
(setq backup-directory-alist `(("." . "~/.emacs_saves"))) | |
(setq backup-by-copying t) | |
(setq delete-old-versions t | |
kept-new-versions 6 | |
kept-old-versions 2 | |
version-control t) | |
;; enable for all programming modes | |
(add-hook 'prog-mode-hook 'subword-mode) | |
(require 'haskell-interactive-mode) | |
(require 'haskell-process) | |
(add-hook 'haskell-mode-hook 'interactive-haskell-mode) | |
(add-hook 'haskell-mode-hook 'haskell-mode-setup) | |
(define-key haskell-mode-map (kbd "C-c C-l") 'haskell-process-load-or-reload) | |
(define-key haskell-mode-map (kbd "C-`") 'haskell-interactive-bring) | |
(define-key haskell-mode-map (kbd "C-c C-t") 'haskell-process-do-type) | |
(define-key haskell-mode-map (kbd "C-c C-i") 'haskell-process-do-info) | |
(define-key haskell-mode-map (kbd "C-c C-c") 'haskell-process-cabal-build) | |
(define-key haskell-mode-map (kbd "C-c C-k") 'haskell-interactive-mode-clear) | |
(define-key haskell-mode-map (kbd "C-c c") 'haskell-process-cabal) | |
(define-key haskell-cabal-mode-map (kbd "C-`") 'haskell-interactive-bring) | |
(define-key haskell-cabal-mode-map (kbd "C-c C-k") 'haskell-interactive-mode-clear) | |
(define-key haskell-cabal-mode-map (kbd "C-c C-c") 'haskell-process-cabal-build) | |
(define-key haskell-cabal-mode-map (kbd "C-c c") 'haskell-process-cabal) | |
(use-package dante | |
:ensure t | |
:after haskell-mode | |
:commands 'dante-mode | |
:init | |
(add-hook 'haskell-mode-hook 'flymake-mode) | |
(remove-hook 'flymake-diagnostic-functions 'flymake-proc-legacy-flymake) | |
(add-hook 'haskell-mode-hook 'dante-mode) | |
) | |
(custom-set-faces | |
;; custom-set-faces was added by Custom. | |
;; If you edit it by hand, you could mess it up, so be careful. | |
;; Your init file should contain only one such instance. | |
;; If there is more than one, they won't work right. | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment