Replace electric-pair-mode with autopair-mode

To make this work without any issues, I also had to switch from
delete-selection-mode to cua-mode, disabling a number of cua-mode's
default keybindings which just annoyed me.

Read the comment in behavior.el for more details.
This commit is contained in:
2012-03-31 11:19:54 +01:00
parent ac6e159f42
commit 8f25f74815
2 changed files with 20 additions and 3 deletions

View File

@@ -2,7 +2,6 @@
(setq-default tab-width 2)
;; Electric behavior
(electric-pair-mode t)
(electric-layout-mode t)
;; Always indent with spaces
@@ -15,8 +14,25 @@
(put 'downcase-region 'disabled nil)
(put 'upcase-region 'disabled nil)
;; Globally enable delete-selection-mode
(delete-selection-mode 1)
;; 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))
;; When using autopair, ECB and delete-selection-mode there's a weird conflict
;; which disables delete-selection-mode whenever you click on a directory of
;; 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)
;; 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
;; undo.
(setq cua-enable-cua-keys nil
cua-remap-control-v nil
cua-remap-control-z nil)
;; Use textmate-mode
(when (require 'textmate nil 'noerror)

View File

@@ -135,6 +135,7 @@
(append
'(auto-complete
auto-complete-emacs-lisp
autopair
coffee-mode
ecb
evil