Fix settings for nrepl.el -> cider
This commit is contained in:
		
							parent
							
								
									47f5ddebc0
								
							
						
					
					
						commit
						6aba1cbda9
					
				
					 3 changed files with 27 additions and 28 deletions
				
			
		|  | @ -54,4 +54,17 @@ | ||||||
| ;; Create new frame | ;; Create new frame | ||||||
| (define-key global-map (kbd "C-x C-n") 'make-frame-command) | (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-backward-input) | ||||||
|  | (define-key cider-repl-mode-map (kbd "<down>") 'cider-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-nrepl-popup-doc) | ||||||
|  | (define-key cider-mode-map (kbd "C-c C-d") 'ac-nrepl-popup-doc) | ||||||
|  | (define-key cider-mode-map (kbd "C-c D") 'cider-doc) | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
| (provide 'init-bindings) | (provide 'init-bindings) | ||||||
|  |  | ||||||
|  | @ -1,4 +1,4 @@ | ||||||
| (mapc 'require '(projectile hi2 ac-nrepl yasnippet)) | (mapc 'require '(projectile ac-nrepl cider)) | ||||||
| ;; Initializes modes I use. | ;; Initializes modes I use. | ||||||
| 
 | 
 | ||||||
| (add-hook 'prog-mode-hook 'esk-add-watchwords) | (add-hook 'prog-mode-hook 'esk-add-watchwords) | ||||||
|  | @ -19,45 +19,30 @@ | ||||||
|           'set-auto-complete-as-completion-at-point-function) |           'set-auto-complete-as-completion-at-point-function) | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| ;; Configure nrepl (Clojure REPL) and clojure-mode | ;; Configure CIDER (Clojure REPL) and clojure-mode | ||||||
| 
 | 
 | ||||||
| (defun nrepl-mode-setup () | (defun cider-mode-setup () | ||||||
|   "Activates paredit, rainbow delimiters and ac-nrepl" |   "Activates paredit, rainbow delimiters and ac-nrepl" | ||||||
|   (ac-nrepl-setup) |   (ac-nrepl-setup) | ||||||
|   (rainbow-delimiters-mode 1) |   (clojure-mode)) | ||||||
|   (paredit-mode 1)) |  | ||||||
| 
 |  | ||||||
| ;; Use ac-nrepl for completion |  | ||||||
| (add-hook 'nrepl-mode-hook 'nrepl-mode-setup) |  | ||||||
| (add-hook 'nrepl-interaction-mode-hook 'nrepl-mode-setup) |  | ||||||
| 
 |  | ||||||
| ;; I want history up/down without modifiers |  | ||||||
| (define-key nrepl-repl-mode-map (kbd "<up>") 'nrepl-backward-input) |  | ||||||
| (define-key nrepl-repl-mode-map (kbd "<down>") 'nrepl-forward-input) |  | ||||||
| (define-key nrepl-repl-mode-map (kbd "C-<up>") 'previous-line) |  | ||||||
| (define-key nrepl-repl-mode-map (kbd "C-<down>") 'next-line) |  | ||||||
| (define-key nrepl-repl-mode-map (kbd "C-c C-d") 'ac-nrepl-popup-doc) |  | ||||||
| 
 |  | ||||||
| (define-key nrepl-interaction-mode-map (kbd "C-c C-d") 'ac-nrepl-popup-doc) |  | ||||||
| (define-key nrepl-interaction-mode-map (kbd "C-c D") 'nrepl-doc) |  | ||||||
| 
 |  | ||||||
| 
 | 
 | ||||||
|  | (add-hook 'cider-repl-mode-hook 'cider-mode-setup) | ||||||
|  | (add-hook 'cider-interaction-mode-hook 'cider-mode-setup) | ||||||
| (eval-after-load "auto-complete" | (eval-after-load "auto-complete" | ||||||
|    '(add-to-list 'ac-modes 'nrepl-mode)) |   '(add-to-list 'ac-modes 'cider-repl-mode)) | ||||||
| 
 | 
 | ||||||
| ;; Paredit in clojure | ;; Paredit in clojure | ||||||
| (add-hook 'clojure-mode-hook 'paredit-mode) | (add-hook 'clojure-mode-hook 'paredit-mode) | ||||||
| 
 | 
 | ||||||
| ;; eldoc in clojure | ;; eldoc in clojure | ||||||
| (add-hook 'nrepl-interaction-mode-hook | (add-hook 'cider-interaction-mode-hook | ||||||
|           'nrepl-turn-on-eldoc-mode) |           'cider-turn-on-eldoc-mode) | ||||||
| 
 |  | ||||||
| (add-hook 'nrepl-interaction-mode-hook |  | ||||||
|           'paredit-mode) |  | ||||||
| 
 | 
 | ||||||
| ;; Don't annoy me | ;; Don't annoy me | ||||||
| (setq nrepl-hide-special-buffers t) | (setq cider-hide-special-buffers t) | ||||||
| (setq nrepl-popup-stacktraces nil) | (setq cider-popup-stacktraces nil) | ||||||
|  | ; (setq cider-repl-pop-to-buffer-on-connect nil) | ||||||
|  | (setq cider-repl-popup-stacktraces t) | ||||||
| 
 | 
 | ||||||
| ;; Enable projectile for all things programming | ;; Enable projectile for all things programming | ||||||
| (add-hook 'prog-mode-hook 'projectile-on) | (add-hook 'prog-mode-hook 'projectile-on) | ||||||
|  |  | ||||||
							
								
								
									
										1
									
								
								init.el
									
										
									
									
									
								
							
							
						
						
									
										1
									
								
								init.el
									
										
									
									
									
								
							|  | @ -21,6 +21,7 @@ | ||||||
|   '(; Basic functionality |   '(; Basic functionality | ||||||
|     ace-jump-mode |     ace-jump-mode | ||||||
|     browse-kill-ring |     browse-kill-ring | ||||||
|  |     dash | ||||||
|     flx-ido |     flx-ido | ||||||
|     flycheck |     flycheck | ||||||
|     idle-highlight-mode |     idle-highlight-mode | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue