0

I am learning my way around Emacs. I installed Ivy/Counsel recently. I am trying to use search with Swiper but cannot get the key binding to work. I can get it to work with M-x swiper. I am not sure where I am going wrong. This is my config:

(ivy-mode 1)
(setq ivy-use-virtual-buffers t)
(setq ivy-count-format "(%d/%d) ")
(setq enable-recursive-minibuffers t)
(global-set-key (kbd "C-s") 'swiper)

I have this as well:

(define-key global-map "\C-s" 'swiper)

None of the above works. I can still use with M-x swiper.

3
  • 1
    What does C-h k C-s give you? The code you list should work, so there must be something else going on - either the code isn't being evaluated, or the key binding is being overwritten by something else.
    – Basil
    Apr 7, 2021 at 13:47
  • 1
    You say "none of the above works". What does that mean - what happens when you press C-s? Does it start an interactive search, or do something else?
    – Tyler
    Apr 7, 2021 at 20:06
  • It shows "undefined" when I use C-s and even when I check with C-h k C-s. I'll try a fresh install of counsel. Because in another system kbd works just fine.
    – celmata
    Apr 8, 2021 at 6:47

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.