Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

expand-region.el is SO MUCH COOLER than my hand-rolled mark-whole-word

  • Loading branch information...
commit 32f800c7272e39137a4d68926dafbdb33e5d8a78 1 parent 527a764
@eentzel authored
Showing with 9 additions and 16 deletions.
  1. +3 −0  .gitmodules
  2. +1 −0  expand-region.el
  3. +5 −2 init.el
  4. +0 −14 mark-whole-word.el
View
3  .gitmodules
@@ -25,3 +25,6 @@
[submodule "Fill-Column-Indicator"]
path = Fill-Column-Indicator
url = https://github.com/alpaker/Fill-Column-Indicator.git
+[submodule "expand-region.el"]
+ path = expand-region.el
+ url = https://github.com/magnars/expand-region.el.git
1  expand-region.el
@@ -0,0 +1 @@
+Subproject commit b047a1cc13880f48e8fcaa892b7884aa1f5bd939
View
7 init.el
@@ -55,6 +55,11 @@
(autoload 'ack-same "full-ack" nil t)
(autoload 'ack "full-ack" nil t)
+;; expand-region.el
+(add-to-list 'load-path "~/.emacs.d/expand-region.el")
+(require 'expand-region)
+(global-set-key (kbd "M-SPC") 'er/expand-region)
+
;; fill-column-indicator
(add-to-list 'load-path "~/.emacs.d/Fill-Column-Indicator")
(require 'fill-column-indicator)
@@ -101,8 +106,6 @@
(load "~/.emacs.d/js2-epe.el"))
(if (file-exists-p "~/.emacs.d/ffap-epe.el")
(load "~/.emacs.d/ffap-epe.el"))
-(if (file-exists-p "~/.emacs.d/mark-whole-word.el")
- (load "~/.emacs.d/mark-whole-word.el"))
(if (file-exists-p "~/.emacs.d/find-file-in-home-dir.el")
(load "~/.emacs.d/find-file-in-home-dir"))
(if (file-exists-p "~/.emacs.d/pyflakes.el")
View
14 mark-whole-word.el
@@ -1,14 +0,0 @@
-(defun mark-whole-word ()
- (interactive)
- (if (and mark-active (null transient-mark-mode))
- ; setting transient-mark-mode to 'lambda instead of t means it
- ; will be deactivated by the next set-mark-command
- (setq transient-mark-mode 'lambda))
- (let* ((thing (if (eq last-command 'mark-whole-word)
- 'filename
- 'word))
- (bounds (bounds-of-thing-at-point thing)))
- (goto-char (car bounds))
- (push-mark (cdr bounds))
- (setq mark-active t)))
-(global-set-key (kbd "M-SPC") 'mark-whole-word)
Please sign in to comment.
Something went wrong with that request. Please try again.