Skip to content

Commit

Permalink
add highlight-symbol for fast jumping
Browse files Browse the repository at this point in the history
  • Loading branch information
bostonaholic committed May 3, 2012
1 parent 43d124d commit 9c00974
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .emacs.d/config-highlight-symbol.el
Original file line number Diff line number Diff line change
@@ -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)
2 changes: 2 additions & 0 deletions .emacs.d/init.el
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
clojurescript-mode
coffee-mode
haml-mode
highlight-symbol
pivotal-tracker
ruby-mode
sass-mode
Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit 9c00974

Please sign in to comment.