Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to search incrementally for an all-lower-case pattern in Emacs?

In Emacs, by default, incremental search is case-insensitive. However, if you type any upper case characters as part of the search string, it becomes a case-sensitive search. So the question is, how do you easily perform a case-sensitive search of an all lower case pattern. The fewer the characters and easier to remember the better. I'm pretty sure this is built in, just can't recall how to do it.

like image 325
WilliamKF Avatar asked Sep 26 '09 17:09

WilliamKF


2 Answers

Emacs' incremental search (that is, isearch-forward) has a lot of modifiers to change the current search's behavior which you can type on the fly immediately after C-s.

From isearch-forward's documentation:

Type M-c to toggle search case-sensitivity.

like image 102
viam0Zah Avatar answered Nov 08 '22 00:11

viam0Zah


Have (setq case-fold-search nil) in your .emacs or M-x set-variable case-fold-search nil.

like image 5
Ashwin Avatar answered Nov 08 '22 00:11

Ashwin