Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Is it possible to search for the thing under the cursor with just one key binding? #1068
@abo-abo Yes, could you please give an example?
I mapped the
But it doesn't work. I'm new to elisp. Please help.
Here's a code that you could use:
(defun ivy-with-thing-at-point (cmd) (let ((ivy-initial-inputs-alist (list (cons cmd (thing-at-point 'symbol))))) (funcall cmd))) ;; Example 1 (defun counsel-ag-thing-at-point () (interactive) (ivy-with-thing-at-point 'counsel-ag)) ;; Example 2 (defun swiper-thing-at-point () (interactive) (ivy-with-thing-at-point 'swiper))