override smartparens key mappings

90 views
Skip to first unread message

JeffMad

unread,
Feb 28, 2016, 4:10:30 PM2/28/16
to Emacs Prelude
Hi, 
I am relatively new to Emacs, I love developing on the Clojure REPL with CIDER.  
I wanted to change the smartparens key mappings from the default set to paredit, but wasn't sure how. 

Can someone please verify that I went about it in a decent way? 

1. I went into  core/prelude-editor.el and commented out all the smartparens statements.  This didn't seem right to me because now when I do git pull there might be conflicts someday
2. I created  personal/smartparens-init.el  and copied several things from  https://github.com/Fuco1/.emacs.d/blob/master/files/smartparens.el 

Sometimes prelude confuses me because when I read emacs blog posts for how to do X, I am not sure if where to put things I want to try, whether it is init.el, or in some file in personal/*.el



diff --git /core/prelude-editor.el b/core/prelude-editor.el

 ;; smart pairing for all
-(require 'smartparens-config)
-(setq sp-base-key-bindings 'paredit)
-(setq sp-autoskip-closing-pair 'always)
-(setq sp-hybrid-kill-entire-symbol nil)
-(sp-use-paredit-bindings)
+;(require 'smartparens-config)
+;(setq sp-base-key-bindings 'paredit)
+;(setq sp-autoskip-closing-pair 'always)
+;(setq sp-hybrid-kill-entire-symbol nil)
+;(sp-use-paredit-bindings)


personal/smartparens-init.el

(require 'smartparens-config)

(add-hook 'minibuffer-setup-hook 'turn-on-smartparens-strict-mode)
(add-hook 'clojure-mode-hook #'smartparens-strict-mode)

;;;;;;;;;;;;;;;;;;;;;;;;
;; keybinding management
(define-key smartparens-mode-map (kbd "C-M-f") 'sp-forward-sexp)
(define-key smartparens-mode-map (kbd "C-M-b") 'sp-backward-sexp)

(define-key smartparens-mode-map (kbd "C-M-d") 'sp-down-sexp)
Reply all
Reply to author
Forward
0 new messages