Switch from autopair to smartparens

The smartparens package also negates the need for ruby-electric-mode,
and doesn't play nice with cua-mode. But my use of cua-mode was due to a
bug between ECB and delete-selection-mode, which seems to now be
fixed. Hence cua-mode is out too.
This commit is contained in:
2014-04-18 15:21:10 +01:00
parent 9932b4cdbe
commit 0a5333ec1d
6 changed files with 18 additions and 22 deletions

View File

@@ -9,6 +9,7 @@
(defalias 'sl 'sort-lines)
(defalias 'rr 'reverse-region)
(defalias 'wc 'whitespace-cleanup)
(defalias 'rw 'sp-rewrap-sexp)
(defalias 'lml 'list-matching-lines)
(defalias 'dml 'delete-matching-lines)

View File

@@ -14,11 +14,6 @@
(put 'downcase-region 'disabled nil)
(put 'upcase-region 'disabled nil)
;; Autopair mode. I'm sorry, electric-pair mode just isn't as good, mainly
;; cause it can't wrap the region in the pair-character you type.
(when (require 'autopair nil 'noerror)
(autopair-global-mode))
;; Enable Projectile global mode.
(when (require 'projectile nil 'noerror)
(projectile-global-mode))
@@ -32,13 +27,8 @@
(recentf-mode 1)
(setq recentf-max-menu-items 100)
;; When using autopair, ECB and delete-selection-mode there's a weird conflict
;; which disables delete-selection-mode whenever you click on a directory or
;; file in ECB's tree buffer. For that reason, and for it's neat rectangle
;; selection feature we're using cua-mode as it's delete-selection-ish feature
;; is not effected by the issue.
(setq cua-rectangle-mark-key (kbd "M-RET"))
(cua-mode t)
;; Enable delete-selection-mode
(delete-selection-mode t)
;; Disable cua-mode's fancy keys like C-z, C-v, etc. cause we use them for
;; other things, and we already have good keybindings for cut, copy, paste and

View File

@@ -16,7 +16,6 @@
'(aquamacs-additional-fontsets nil t)
'(aquamacs-customization-version-id 211 t)
'(aquamacs-tool-bar-user-customization nil t)
'(autopair-global-mode t)
'(column-number-mode t)
'(display-time-24hr-format t)
'(display-time-day-and-date nil)
@@ -142,4 +141,5 @@
'(mumamo-background-chunk-submode2 ((t nil)) t)
'(mumamo-background-chunk-submode3 ((t nil)) t)
'(mumamo-background-chunk-submode4 ((t nil)) t)
'(persp-selected-face ((t (:foreground "royal blue" :weight bold)))))
'(persp-selected-face ((t (:foreground "royal blue" :weight bold))))
'(sp-pair-overlay-face ((t (:inherit nil)))))

View File

@@ -176,6 +176,14 @@
(define-key global-map (kbd "M-p") 'move-text-up)
(define-key global-map (kbd "M-n") 'move-text-down))
;; smartparens
(when (require 'smartparens nil 'noerror)
;; Must be set after textmate is required.
(define-key sp-keymap (kbd "M-F") 'sp-forward-symbol)
(define-key sp-keymap (kbd "M-B") 'sp-backward-symbol)
(define-key sp-keymap (kbd "C-M-f") 'sp-forward-sexp)
(define-key sp-keymap (kbd "C-M-b") 'sp-backward-sexp))
;; Set/increase/decrease transparency (via helpers.el)
(global-set-key (kbd "C-M-|") 'transparency-set-value)
(global-set-key (kbd "C-M-<") 'transparency-increase)

View File

@@ -17,10 +17,6 @@
(defun customizations-for-ruby-mode ()
(interactive)
(when (require 'ruby-electric nil 'noerror)
(ruby-electric-mode t)
(setq ruby-electric-expand-delimiters-list (quote (124))))
(when (require 'ruby-compilation nil 'noerror)
(define-key ruby-mode-map (kbd "s-r") 'ruby-compilation-this-buffer)
(define-key ruby-mode-map (kbd "C-c C-r") 'ruby-compilation-this-buffer))

View File

@@ -30,7 +30,6 @@
ace-jump-mode
ack-and-a-half
auto-complete
autopair
browse-kill-ring
buffer-move
coffee-mode
@@ -78,10 +77,10 @@
rhtml-mode
rubocop
ruby-compilation
ruby-electric
ruby-interpolation
sass-mode
scss-mode
smartparens
smex
smooth-scrolling
stylus-mode
@@ -181,8 +180,10 @@
(when (require 'workgroups2 nil 'noerror)
(workgroups-mode 1))
;; Load ruby-electric (autoload fails)
(require 'ruby-electric)
;; smartparens
(when (require 'smartparens nil 'noerror)
(require 'smartparens-config)
(smartparens-global-mode))
;; Load Undo-Tree
(require 'undo-tree)