Permalink
Browse files

add highlight-symbol for fast jumping

  • Loading branch information...
1 parent 43d124d commit 9c00974408487361261d483606ad7512b0409a1d @bostonaholic bostonaholic committed May 3, 2012
Showing with 20 additions and 0 deletions.
  1. +18 −0 .emacs.d/config-highlight-symbol.el
  2. +2 −0 .emacs.d/init.el
@@ -0,0 +1,18 @@
+(defun hl-symbol-and-jump ()
+ (interactive)
+ (let ((symbol (highlight-symbol-get-symbol)))
+ (unless symbol (error "No symbol at point"))
+ (unless hi-lock-mode (hi-lock-mode 1))
+ (if (member symbol highlight-symbol-list)
+ (highlight-symbol-next)
+ (highlight-symbol-at-point)
+ (highlight-symbol-next))))
+
+(defun hl-symbol-cleanup ()
+ (interactive)
+ (mapc 'hi-lock-unface-buffer highlight-symbol-list)
+ (setq highlight-symbol-list ()))
+
+(global-set-key (kbd "C-x *") 'highlight-symbol-next)
+(global-set-key (kbd "C-*") 'highlight-symbol-prev)
+;;(global-set-key (kbd) 'hl-symbol-cleanup)
View
@@ -19,6 +19,7 @@
clojurescript-mode
coffee-mode
haml-mode
+ highlight-symbol
pivotal-tracker
ruby-mode
sass-mode
@@ -72,6 +73,7 @@
(load "config-bindings")
(load "config-cosmetics")
(load "config-defuns")
+(load "config-highlight-symbol")
(load "config-hooks")
(load "config-osx")
(load "config-registers")

0 comments on commit 9c00974

Please sign in to comment.