From f88d106fc37ca6a3057789c236d70eb49ec58528 Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Fri, 29 May 2015 22:33:26 -0400 Subject: Make avy-goto-subword-1 ignore invisible text --- lisp/init-ace.el | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'lisp') diff --git a/lisp/init-ace.el b/lisp/init-ace.el index e971121..d033e52 100644 --- a/lisp/init-ace.el +++ b/lisp/init-ace.el @@ -1,6 +1,17 @@ ;;; Avy -(key-chord-define-global "jf" 'avy-goto-subword-1) +(require 'avy) + +(defun km/avy-goto-subword-1 (char arg) + "Like `avy-goto-subword-1', but don't consider invisible text." + (interactive (list (read-char "char: ") current-prefix-arg)) + (avy--with-avy-keys avy-goto-subword-1 + (let ((char (downcase char))) + (avy-goto-subword-0 + arg (lambda () (and (not (invisible-p (point))) + (eq (downcase (char-after)) char))))))) + +(key-chord-define-global "jf" 'km/avy-goto-subword-1) ;;; Ace Link -- cgit v1.2.3