help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Is there an easier way to jump to the same word?


From: Renaud Casenave-Péré
Subject: Re: Is there an easier way to jump to the same word?
Date: Fri, 12 Apr 2013 06:50:19 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (windows-nt)

On Fri, Apr 12 2013, Renaud Casenave-Péré wrote:

> You may find this solution a bit overkill, but if you install evil, you can 
> use
> something like this :
>
> (global-set-key (kbd "C-*") #'(lambda ()
>                                 (interactive)
>                                 (evil-search-symbol t))) ;; search forward
>
> (global-set-key (kbd "C-#") #'(lambda ()
>                                 (interactive)
>                                 (evil-search-symbol nil))) ;; search backward
>
> which does what you want and should work even if you don't use evil at all as
> long as you do (require 'evil-search).

Another (beggining of a) solution. With something like this :

(defun isearch-yank-word-at-point ()
  "Pull the word at point into search string."
  (interactive)
  (goto-char (beginning-of-thing 'word))
  (isearch-yank-internal
   #'(lambda ()
       (end-of-thing 'word))))

(define-key isearch-mode-map (kbd "C-*") 'isearch-yank-word-at-point)

In combination with `isearch-forward-word', you can jump to the next iteration
of the word you are on, using only isearch and thing-at-point facilities.

-- 
Renaud Casenave-Pere



reply via email to

[Prev in Thread] Current Thread [Next in Thread]