Disable er in org/rst-mode. Expand to line with \n by default.
authorOleksandr Gavenko <gavenkoa@gmail.com>
Tue, 07 Nov 2017 22:00:04 +0200
changeset 1547 a4e4e54c257a
parent 1546 4939c41ef080
child 1548 f7b46111fd5a
Disable er in org/rst-mode. Expand to line with \n by default.
.emacs-my
--- a/.emacs-my	Tue Oct 31 10:58:29 2017 +0200
+++ b/.emacs-my	Tue Nov 07 22:00:04 2017 +0200
@@ -892,9 +892,20 @@
   (setq x-select-enable-clipboard t))
 
 (when (fboundp 'er/expand-region)
-  (global-set-key (kbd "C-=") 'er/expand-region))
-
-(setq-default er/try-expand-list '(er/mark-word er/mark-symbol er/mark-inside-quotes er/mark-outside-quotes er/mark-inside-pairs er/mark-outside-pairs))
+  (global-set-key (kbd "s-=") 'er/expand-region))
+
+(defun my-mark-line ()
+  "Mark current line."
+  (forward-line 0)
+  (set-mark (point))
+  (forward-line 1)
+  (exchange-point-and-mark))
+
+(setq-default er/try-expand-list '(er/mark-word er/mark-symbol er/mark-inside-quotes er/mark-outside-quotes er/mark-inside-pairs er/mark-outside-pairs my-mark-line))
+
+(my--eval-after-load text-mode-expansions
+  (add-to-list 'expand-region-exclude-text-mode-expansions 'org-mode)
+  (add-to-list 'expand-region-exclude-text-mode-expansions 'rst-mode))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 (message "highlighting current line")