diff options
author | Vincent Ambo <vincent@kivra.com> | 2014-12-29T20·51+0100 |
---|---|---|
committer | Vincent Ambo <vincent@kivra.com> | 2014-12-29T20·51+0100 |
commit | fb9a837c67a3f7e15c89daad168f2982aa3be8cc (patch) | |
tree | 830643ffade4477057c93b8920bd4b7d3a28f12b /init | |
parent | 677eba3e60b5f1b1473524a83e4d73dae1cba99b (diff) |
Split out Haskell and Clojure config
Diffstat (limited to 'init')
-rw-r--r-- | init/bindings.el | 12 | ||||
-rw-r--r-- | init/clojure.el | 45 | ||||
-rw-r--r-- | init/haskell.el | 25 | ||||
-rw-r--r-- | init/modes.el | 39 |
4 files changed, 77 insertions, 44 deletions
diff --git a/init/bindings.el b/init/bindings.el index d29081d1720b..c62daad544cd 100644 --- a/init/bindings.el +++ b/init/bindings.el @@ -57,18 +57,6 @@ ;; Create new frame (define-key global-map (kbd "C-x C-n") 'make-frame-command) -;; Cider/nrepl stuff -;; I want history up/down without modifiers -(define-key cider-repl-mode-map (kbd "<up>") 'cider-repl-backward-input) -(define-key cider-repl-mode-map (kbd "<down>") 'cider-repl-forward-input) -(define-key cider-repl-mode-map (kbd "C-<up>") 'previous-line) -(define-key cider-repl-mode-map (kbd "C-<down>") 'next-line) - -;; ... and ac-cider with C-c C-d -(define-key cider-repl-mode-map (kbd "C-c C-d") 'ac-cider-compliment-popup-doc) -(define-key cider-mode-map (kbd "C-c C-d") 'ac-cider-compliment-popup-doc) -(define-key cider-mode-map (kbd "C-c D") 'cider-doc) - ;; Org-mode agenda keys (global-set-key (kbd "C-c a") 'org-agenda) diff --git a/init/clojure.el b/init/clojure.el new file mode 100644 index 000000000000..5ec4848b8fa3 --- /dev/null +++ b/init/clojure.el @@ -0,0 +1,45 @@ +(require 'cider) +(require 'ac-cider-compliment) + +;; Configure CIDER (Clojure REPL) and clojure-mode + +(defun cider-mode-setup () + "Activates paredit, rainbow delimiters and ac-nrepl" + (ac-cider-compliment-setup) + (ac-flyspell-workaround) + (paredit-mode)) + +(eval-after-load "auto-complete" + '(add-to-list 'ac-modes cider-mode)) + +(add-hook 'cider-repl-mode-hook 'cider-mode-setup) +(add-hook 'cider-interaction-mode-hook 'cider-mode-setup) +(eval-after-load "auto-complete" + '(add-to-list 'ac-modes 'cider-repl-mode)) + +;; Paredit in clojure +(add-hook 'clojure-mode-hook 'paredit-mode) + +;; eldoc in clojure +(add-hook 'cider-interaction-mode-hook + 'cider-turn-on-eldoc-mode) + +;; Don't annoy me +(setq cider-hide-special-buffers t) +(setq cider-popup-stacktraces nil) +(setq cider-repl-pop-to-buffer-on-connect nil) +(setq cider-repl-popup-stacktraces t) + +;; I want history up/down without modifiers +(define-key cider-repl-mode-map (kbd "<up>") 'cider-repl-backward-input) +(define-key cider-repl-mode-map (kbd "<down>") 'cider-repl-forward-input) +(define-key cider-repl-mode-map (kbd "C-<up>") 'previous-line) +(define-key cider-repl-mode-map (kbd "C-<down>") 'next-line) + +;; ... and ac-cider with C-c C-d +(define-key cider-repl-mode-map (kbd "C-c C-d") 'ac-cider-compliment-popup-doc) +(define-key cider-mode-map (kbd "C-c C-d") 'ac-cider-compliment-popup-doc) +(define-key cider-mode-map (kbd "C-c D") 'cider-doc) + + +(provide 'clojure) diff --git a/init/haskell.el b/init/haskell.el new file mode 100644 index 000000000000..af105e00e8ac --- /dev/null +++ b/init/haskell.el @@ -0,0 +1,25 @@ +(require 'haskell-mode) + +;; Setup for Haskell mode + +;; Bindings + +(eval-after-load "haskell-mode" + '(define-key haskell-mode-map (kbd "C-c C-c") 'haskell-compile)) + +(eval-after-load "haskell-cabal" + '(define-key haskell-cabal-mode-map (kbd "C-c C-c") 'haskell-compile)) + +(add-hook 'haskell-mode-hook 'hi2-mode) + +;; Settings + +(setq haskell-interactive-popup-errors t + haskell-stylish-on-save t + haskell-tags-on-save t + haskell-process-suggest-remove-import-types t + haskell-process-auto-import-loaded-modules t + haskell-process-log t + haskell-process-type 'cabal-repl) + +(provide 'haskell) diff --git a/init/modes.el b/init/modes.el index a28ece3e57f0..c1d5c37253cd 100644 --- a/init/modes.el +++ b/init/modes.el @@ -1,4 +1,5 @@ -(mapc 'require '(projectile ac-cider-compliment cider)) +(require 'projectile) + ;; Initializes modes I use. (add-hook 'prog-mode-hook 'esk-add-watchwords) @@ -18,34 +19,12 @@ (add-hook 'auto-complete-mode-hook 'set-auto-complete-as-completion-at-point-function) -;; Configure CIDER (Clojure REPL) and clojure-mode - -(defun cider-mode-setup () - "Activates paredit, rainbow delimiters and ac-nrepl" - (ac-cider-compliment-setup) - (ac-flyspell-workaround) - (paredit-mode)) - -(eval-after-load "auto-complete" - '(add-to-list 'ac-modes cider-mode)) - -(add-hook 'cider-repl-mode-hook 'cider-mode-setup) -(add-hook 'cider-interaction-mode-hook 'cider-mode-setup) -(eval-after-load "auto-complete" - '(add-to-list 'ac-modes 'cider-repl-mode)) +;; Configure Erlang mode -;; Paredit in clojure -(add-hook 'clojure-mode-hook 'paredit-mode) - -;; eldoc in clojure -(add-hook 'cider-interaction-mode-hook - 'cider-turn-on-eldoc-mode) - -;; Don't annoy me -(setq cider-hide-special-buffers t) -(setq cider-popup-stacktraces nil) -(setq cider-repl-pop-to-buffer-on-connect nil) -(setq cider-repl-popup-stacktraces t) +;; Don't indent after '>' while I'm writing +(add-hook 'erlang-mode-hook + '(lambda () + (local-set-key ">" 'self-insert-command))) ;; Enable projectile for all things programming (add-hook 'prog-mode-hook 'projectile-mode) @@ -56,10 +35,6 @@ ;; Enable Paredit in Emacs Lisp mode (add-hook 'emacs-lisp-mode-hook 'paredit-mode) -;; Configure Haskell mode -;; Indentation ... -(add-hook 'haskell-mode-hook 'hi2-mode) - ;; Always highlight matching brackets (show-paren-mode 1) |