If you want the selected match to be displayed as an arrow, you should customize ivy-format-function
, here's the definition:
(defcustom ivy-format-function 'ivy-format-function-default
"Function to transform the list of candidates into a string.
This string is inserted into the minibuffer."
:type '(choice
(const :tag "Default" ivy-format-function-default)
(const :tag "Arrow prefix" ivy-format-function-arrow)
(const :tag "Full line" ivy-format-function-line)))
The option that you want is thus:
(setq ivy-format-function 'ivy-format-function-arrow)
If you insist on having ->
instead of the default >
, look up the definition:
(defun ivy-format-function-arrow (cands)
"Transform CAND-PAIRS into a string for minibuffer."
(ivy--format-function-generic
(lambda (str)
(concat "> " (ivy--add-face str 'ivy-current-match)))
(lambda (str)
(concat " " str))
cands
"\n"))
Copy-paste into your own function:
(defun my-ivy-format-function-arrow (cands)
"Transform CAND-PAIRS into a string for minibuffer."
(ivy--format-function-generic
(lambda (str)
(concat "-> " (ivy--add-face str 'ivy-current-match)))
(lambda (str)
(concat " " str))
cands
"\n"))
(setq ivy-format-function 'my-ivy-format-function-arrow)
If you're not very experienced with Elisp, I recommend to go through M-x customize-group
ivy
and use the GUI to play around with the parameters.