5

How can I change Emacs so that the regexp search (instead of normal search) is the default?

I would like to be able to type C-s [0-9], for example, and it takes me to the next number. Then, press C-s again, and it takes me to the next number.

I tried this:

(global-set-key "\C-s" 'search-forward-regexp)

But the repeated pressing of C-s does not work. It does find the first occurrence, but to find the second you have to re-enter the regexp [0-9] after pressing C-s.

1 Answer 1

6

You're close - use isearch-forward-regexp - note the 'i'.

Found via 'C-h k C-M-s' which is bound to interactive regexp search forward.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .