Split out Haskell and Clojure config
This commit is contained in:
parent
677eba3e60
commit
fb9a837c67
5 changed files with 81 additions and 45 deletions
5
init.el
5
init.el
|
@ -70,7 +70,10 @@
|
|||
settings
|
||||
modes
|
||||
bindings
|
||||
eshell-setup))
|
||||
eshell-setup
|
||||
clojure
|
||||
haskell
|
||||
))
|
||||
|
||||
(add-to-list 'load-path (concat user-emacs-directory "scripts"))
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
45
init/clojure.el
Normal file
45
init/clojure.el
Normal file
|
@ -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)
|
25
init/haskell.el
Normal file
25
init/haskell.el
Normal file
|
@ -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)
|
|
@ -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
|
||||
;; Configure Erlang 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)
|
||||
;; 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)
|
||||
|
||||
|
|
Loading…
Reference in a new issue