Is it possible to search for the thing under the cursor with just one key binding? #1068
Comments
There's no option to do this. But it's easy to write some custom code. I can give an example if you need it. |
@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)) |
@abo-abo tried it, doesn't work. The thing is that, unlike Swiper, the |
@mtuzinskiy You should update the package from Git, or wait a few hours and update from MELPA. |
This was working great for me until recently. Now running @abo-abo do you have any suggestions what may be going on? Thanks! |
@wykurz If this is something you can reliably reproduce, please submit a bug report with a reproduction recipe. TIA. |
Yes, it's 100% reproducible. Created this: #2737 |
For others trying to use this - (global-set-key (kbd "M-s") 'swiper-thing-at-point) |
I know
C-s C-w
orC-s M-n
could do it. But I wonder if this can be done with just 1 key binding.The text was updated successfully, but these errors were encountered: