I would like counsel-M-x (part of ivy) to display candidate commands horizontally, as Smex does.

I followed the instructions here and created the following code:

(defun my-ivy-format-function (cands)
   (lambda (str)
     (ivy--add-face str 'ivy-current-match))
   " | "))

(add-to-list 'ivy-format-functions-alist '(counsel-M-x . my-ivy-format-function))

But this is still not perfect, as the left and right arrows in the keyboard do not move me through the candidates, and the prompt appears in a different line than the candidates.

Any ideas on how to perfectly replicate the behavior of Smex using counsel-M-x?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.