Replace electric-indent-mode and paredit with smartparens

This commit is contained in:
Bozhidar Batsov 2013-06-29 11:09:16 +03:00
parent f76aab7491
commit 427bc31866
5 changed files with 15 additions and 16 deletions

View file

@ -100,7 +100,8 @@ With a prefix ARG open line above the current line."
(prelude-smart-open-line-above)
(progn
(move-end-of-line nil)
(newline-and-indent))))
(newline-and-indent)
(shit))))
(defun prelude-top-join-line ()
"Join the current line with the line beneath it."
@ -321,12 +322,12 @@ the current buffer."
(interactive)
(insert (format-time-string "%c" (current-time))))
(defun prelude-conditionally-enable-paredit-mode ()
"Enable `paredit-mode' in the minibuffer, during `eval-expression'."
(if (eq this-command 'eval-expression)
(paredit-mode 1)))
;; (defun prelude-conditionally-enable-paredit-mode ()
;; "Enable `paredit-mode' in the minibuffer, during `eval-expression'."
;; (if (eq this-command 'eval-expression)
;; (paredit-mode 1)))
(add-hook 'minibuffer-setup-hook 'prelude-conditionally-enable-paredit-mode)
;; (add-hook 'minibuffer-setup-hook 'prelude-conditionally-enable-paredit-mode)
(defun prelude-recentf-ido-find-file ()
"Find a recent file using ido."

View file

@ -102,7 +102,9 @@ Will only occur if prelude-whitespace is also enabled."
try-complete-lisp-symbol))
;; smart pairing for all
(electric-pair-mode t)
(setq sp-base-key-bindings 'paredit)
(require 'smartparens-config)
(smartparens-global-mode +1)
;; diminish keeps the modeline tidy
(require 'diminish)

View file

@ -46,7 +46,7 @@
git-commit-mode gitconfig-mode gitignore-mode
guru-mode helm helm-projectile ido-ubiquitous
key-chord magit melpa rainbow-mode
smex solarized-theme undo-tree
smartparens smex solarized-theme undo-tree
volatile-highlights yasnippet zenburn-theme)
"A list of packages to ensure are installed at launch.")

View file

@ -33,29 +33,24 @@
;;; Code:
(require 'prelude-programming)
(prelude-ensure-module-deps '(paredit rainbow-delimiters))
(prelude-ensure-module-deps '(rainbow-delimiters))
;; Lisp configuration
(define-key read-expression-map (kbd "TAB") 'lisp-complete-symbol)
;; a great lisp coding hook
(defun prelude-lisp-coding-defaults ()
(paredit-mode +1)
(rainbow-delimiters-mode +1))
(setq prelude-lisp-coding-hook 'prelude-lisp-coding-defaults)
;; interactive modes don't need whitespace checks
(defun prelude-interactive-lisp-coding-defaults ()
(paredit-mode +1)
(rainbow-delimiters-mode +1)
(whitespace-mode -1))
(setq prelude-interactive-lisp-coding-hook 'prelude-interactive-lisp-coding-defaults)
(eval-after-load "paredit"
'(diminish 'paredit-mode " π"))
(provide 'prelude-lisp)
;;; prelude-lisp.el ends here

View file

@ -33,7 +33,9 @@
;;; Code:
(require 'prelude-programming)
(prelude-ensure-module-deps '(ruby-tools inf-ruby yari ruby-end))
(require 'smartparens-ruby)
(prelude-ensure-module-deps '(ruby-tools inf-ruby yari))
;; Rake files are ruby, too, as are gemspecs, rackup files, and gemfiles.
(add-to-list 'auto-mode-alist '("\\.rake\\'" . ruby-mode))
@ -59,7 +61,6 @@
(inf-ruby-setup-keybindings)
;; turn off the annoying input echo in irb
(setq comint-process-echoes t)
(ruby-end-mode +1)
(ruby-tools-mode +1)
;; CamelCase aware editing operations
(subword-mode +1))