Add haskell configuration in its own separate file
This commit is contained in:
parent
42ebb1394d
commit
79a7451546
6 changed files with 81 additions and 44 deletions
|
|
@ -3,20 +3,7 @@
|
|||
;;; Code:
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;; Overall behaviour ;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
(setq backup-directory-alist
|
||||
`((".*" . "~/.emacs_backups/auto-save-list")))
|
||||
(setq auto-save-file-name-transforms
|
||||
`((".*", "~/.emacs_backups/auto-save-list" t)))
|
||||
|
||||
(setq backup-by-copying t)
|
||||
(setq delete-old-versions t
|
||||
kept-new-versions 6
|
||||
kept-old-versions 2
|
||||
version-control t)
|
||||
|
||||
; Use Shells variables
|
||||
(when (memq window-system '(mac ns))
|
||||
(exec-path-from-shell-initialize))
|
||||
(setq debug-on-error t)
|
||||
|
||||
;;; remove menu bar and icons
|
||||
(menu-bar-mode -1)
|
||||
|
|
@ -29,25 +16,34 @@
|
|||
; Enable diff highlights (useful for git)
|
||||
(require 'diff-hl)
|
||||
|
||||
(global-diff-hl-mode)
|
||||
(diff-hl-flydiff-mode)
|
||||
(diff-hl-margin-mode)
|
||||
(global-diff-hl-mode 1)
|
||||
(diff-hl-flydiff-mode 1)
|
||||
(diff-hl-margin-mode 1)
|
||||
(setq diff-hl-side 'right)
|
||||
(add-hook 'magit-post-refresh-hook 'diff-hl-magit-post-refresh)
|
||||
|
||||
; Add pgp binary
|
||||
(add-to-list 'exec-path "/usr/local/bin")
|
||||
|
||||
; Enable line numbers and show cursors position
|
||||
(global-linum-mode t)
|
||||
(column-number-mode 1)
|
||||
;; (global-hl-line-mode)
|
||||
|
||||
;; Turn off sounds
|
||||
(setq ring-bell-function 'ignore)
|
||||
|
||||
;; Enable y/n answers to questions
|
||||
(fset 'yes-or-no-p 'y-or-n-p)
|
||||
|
||||
;#====================== Backup config #==============================
|
||||
(setq backup-directory-alist
|
||||
`((".*" . "~/.emacs_backups/auto-save-list")))
|
||||
(setq auto-save-file-name-transforms
|
||||
`((".*", "~/.emacs_backups/auto-save-list" t)))
|
||||
|
||||
(setq backup-by-copying t)
|
||||
(setq delete-old-versions t
|
||||
kept-new-versions 6
|
||||
kept-old-versions 2
|
||||
version-control t)
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;; code behaviour ;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
; Add ruler at 80, do not wrap lines (can be overwritten later)
|
||||
|
|
@ -62,7 +58,6 @@
|
|||
(add-hook 'prog-mode-hook 'whitespace-mode)
|
||||
(setq whitespace-style '(face trailing empty))
|
||||
|
||||
(add-hook 'before-save-hook 'delete-trailing-lines)
|
||||
(add-hook 'before-save-hook 'whitespace-cleanup) ; Cleanup whitespace on save
|
||||
|
||||
;; Tabs are spaces and are general at 2. Guide indent with lines
|
||||
|
|
@ -91,6 +86,13 @@
|
|||
;;;;;;;;;;;;;;;;;;;;;; Shell stuff ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
(add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on)
|
||||
|
||||
;; Add pgp binary
|
||||
(add-to-list 'exec-path "/usr/local/bin")
|
||||
|
||||
; Use Shells variables
|
||||
(when (memq window-system '(mac ns))
|
||||
(exec-path-from-shell-initialize))
|
||||
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;; indentation functions ;;;;;;;;;;;;;;;;;;;;;;
|
||||
;;; NB! This does not work reliably, using the functions below
|
||||
|
|
@ -164,13 +166,12 @@
|
|||
; Use VIM mode
|
||||
(require 'evil)
|
||||
(require 'evil-leader)
|
||||
(global-evil-leader-mode)
|
||||
(evil-mode 1)
|
||||
(global-evil-leader-mode t)
|
||||
(evil-mode t)
|
||||
|
||||
;; Add magit for git
|
||||
(require 'evil-magit)
|
||||
|
||||
|
||||
;; Additional configuration for flycheck.
|
||||
(require 'flycheck)
|
||||
(setq flycheck-highlighting-mode 'lines)
|
||||
|
|
@ -179,7 +180,6 @@
|
|||
(require 'projectile)
|
||||
(projectile-mode)
|
||||
|
||||
|
||||
(defun projectile-regenerate-tags-if-exist ()
|
||||
"Only regenerate tags if a tag file is present in the folder."
|
||||
(interactive)
|
||||
|
|
|
|||
|
|
@ -15,22 +15,7 @@
|
|||
(load "~/.emacs.d/languages/web.elc")
|
||||
(load "~/.emacs.d/languages/js.elc")
|
||||
(load "~/.emacs.d/languages/sql.elc")
|
||||
|
||||
|
||||
;;; Haskell
|
||||
(defun haskell-mode-config ()
|
||||
"Call haskell mode config."
|
||||
(remove-hook 'ruby-mode-hook 'ruby-mode-config)
|
||||
(remove-hook 'rust-mode-hook 'rust-mode-config)
|
||||
(remove-hook 'emacs-lisp-mode-hook 'elisp-mode-config)
|
||||
(remove-hook 'html-mode-hook 'web-mode-config)
|
||||
(remove-hook 'elixir-mode-hook 'elixir-mode-config)
|
||||
|
||||
(set-indent 4))
|
||||
|
||||
(add-hook 'haskell-mode-hook 'haskell-mode-config)
|
||||
(add-hook 'haskell-mode-hook 'flycheck-mode)
|
||||
(add-hook 'haskell-mode-hook 'set-width-80)
|
||||
(load "~/.emacs.d/languages/haskell.elc")
|
||||
|
||||
;;; Java
|
||||
(defun java-mode-config ()
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
(require 'package)
|
||||
(add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/"))
|
||||
(package-initialize)
|
||||
(if (display-graphic-p) ; If GUI version
|
||||
(if (display-graphic-p) ; Run this only if there's GUI
|
||||
(progn
|
||||
(package-refresh-contents))) ; Refresh only once, on startup
|
||||
|
||||
|
|
@ -193,6 +193,12 @@
|
|||
(unless (package-installed-p 'haskell-mode)
|
||||
(package-install 'haskell-mode))
|
||||
|
||||
(unless (package-installed-p 'scion)
|
||||
(package-install 'scion))
|
||||
|
||||
(unless (package-installed-p 'company-ghci)
|
||||
(package-install 'company-ghci))
|
||||
|
||||
;; Scala
|
||||
(unless (package-installed-p 'scala-mode)
|
||||
(package-install 'scala-mode))
|
||||
|
|
|
|||
13
config/splash.el
Normal file
13
config/splash.el
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
;;; splash.el -- Splash screen
|
||||
;;; Commentary:
|
||||
;;; Code:
|
||||
;; ================================== remove splash screen =====================
|
||||
|
||||
;; (setq inhibit-splash-screen t)
|
||||
|
||||
;; (setq initial-scratch-message
|
||||
;; (concat ";;; Welcome to Emacs." "\n"
|
||||
;; "Was there a problem?"))
|
||||
|
||||
(provide 'splash)
|
||||
;;; splash.el ends here
|
||||
3
init.el
3
init.el
|
|
@ -11,6 +11,7 @@
|
|||
(load "~/.emacs.d/config/packages.elc")
|
||||
(load "~/.emacs.d/config/functions.elc")
|
||||
(load "~/.emacs.d/config/behaviour.elc")
|
||||
(load "~/.emacs.d/config/splash.elc")
|
||||
(load "~/.emacs.d/config/themes.elc")
|
||||
(load "~/.emacs.d/config/key-bindings.elc")
|
||||
(load "~/.emacs.d/config/spelling.elc")
|
||||
|
|
@ -26,7 +27,7 @@
|
|||
;; If there is more than one, they won't work right.
|
||||
'(package-selected-packages
|
||||
(quote
|
||||
(hlinum etags-select nvm tide yaml-mode window-purpose web-mode ujelly-theme toml-mode smart-mode-line scala-mode rvm ruby-end rspec-mode robe rainbow-mode rainbow-delimiters racer pyenv-mode noctilux-theme monokai-theme markdown-mode less-css-mode json-reformat jade-mode indent-guide helm-themes helm-projectile helm-ag haskell-mode haml-mode groovy-mode flymake-ruby flymake-cursor flycheck flatui-theme exec-path-from-shell evil-nerd-commenter evil-magit evil-leader elpy dumb-jump dockerfile-mode diff-hl dash-at-point company-tern company-racer company-jedi column-enforce-mode color-theme-approximate base16-theme atom-one-dark-theme alchemist aggressive-indent ag)))
|
||||
(company-ghci scion hlinum etags-select nvm tide yaml-mode window-purpose web-mode ujelly-theme toml-mode smart-mode-line scala-mode rvm ruby-end rspec-mode robe rainbow-mode rainbow-delimiters racer pyenv-mode noctilux-theme monokai-theme markdown-mode less-css-mode json-reformat jade-mode indent-guide helm-themes helm-projectile helm-ag haskell-mode haml-mode groovy-mode flymake-ruby flymake-cursor flycheck flatui-theme exec-path-from-shell evil-nerd-commenter evil-magit evil-leader elpy dumb-jump dockerfile-mode diff-hl dash-at-point company-tern company-racer company-jedi column-enforce-mode color-theme-approximate base16-theme atom-one-dark-theme alchemist aggressive-indent ag)))
|
||||
'(safe-local-variable-values (quote ((encoding . utf-8)))))
|
||||
(custom-set-faces
|
||||
;; custom-set-faces was added by Custom.
|
||||
|
|
|
|||
32
languages/haskell.el
Normal file
32
languages/haskell.el
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
;;; Haskell -- summary
|
||||
;;; Commentary:
|
||||
|
||||
;;; Code:
|
||||
;;========== Editor config =========================
|
||||
(defun editor-config-haskell ()
|
||||
"Editor configuration for Haskell."
|
||||
(set-indent 4)
|
||||
(set-width-80))
|
||||
|
||||
;;========== Code completion =======================
|
||||
(defun completion-config-haskell ()
|
||||
"Code completion and inspection for Javascript."
|
||||
(company-mode 1)
|
||||
(flycheck-mode 1)
|
||||
(flymake-mode 1)
|
||||
(set (make-local-variable 'company-backends)
|
||||
'((company-ghci company-capf company-etags company-dabbrev-code
|
||||
company-yasnippet company-files))))
|
||||
|
||||
:;========== Scion mode ============================
|
||||
;; (defun scion-config-haskell ()
|
||||
;; "Configuration for scion mode."
|
||||
;; (scion-mode 1))
|
||||
|
||||
;;========== Hooks =================================
|
||||
(add-hook 'haskell-mode-hook 'edito-config-haskell)
|
||||
(add-hook 'haskell-mode-hook 'completion-config-haskell)
|
||||
;; (add-hook 'haskell-mode-hook 'scion-config-haskell)
|
||||
|
||||
(provide 'haskell)
|
||||
;;; haskell.el ends here
|
||||
Loading…
Add table
Add a link
Reference in a new issue