Ivy Initial Input String

If you’re an Ivy user—and you should be—you’ve probably noticed that sometimes the Ivy prompt will have an initial “^” so that the search will be anchored at the beginning of line. This happens depending on the command that called the ivy-read routine. If Ivy guesses wrong, you can always remove the “^” or add one.

Sometimes, though, it always guesses wrong for your particular work flow. I’ve just learned from this Emacs subreddit question that you can, to an extent, control when the “^” is appended to the prompt. Actually, you can specify any string to prepend.

The decision as to what to append is controlled by the ivy-initial-inputs-alist. Again, you can easily correct the default action at the time of the call so unless you have a situation where Ivy is always guessing wrong, it’s probably not worth changing the default value of ivy-initial-inputs-alist.

This entry was posted in General and tagged . Bookmark the permalink.