11
votes
Accepted
How to do case sensitive searches using evil's evil-search?
What to do
You can customize the variable evil-ex-search-case to tell it
what you want evil to do when searching. Here's the docstring:
evil-ex-search-case is a variable defined in evil-vars.el.
...

Dan♦
- 32.7k
8
votes
Accepted
how do I do case sensitive searches using evil/spacemacs?
Short and narrow answer
You need to set the variable case-fold-search to nil in order
to have case sensitive search. So: put this somewhere in your init file:
(setq case-fold-search nil)
See the ...

Dan♦
- 32.7k
6
votes
Accepted
How to turn every ALL CAP word in a buffer into Title case?
How about using keyboard macros:
<f3> -- start recording
C-M-s \b[A-Z]\{2,\}\b RET -- find the next word of only upper-case letters and at least 2 letters.
M--M-c -- Call capitalize-word on the ...
6
votes
Accepted
in Emacs regex, how to search for uppercase letters only?
You can temporarily bind case-fold-search using let:
(let ((case-fold-search nil))
(looking-at "[\n\t ]*[A-Z]"))
Also, I changed your regexp for matching whitespace and newlines -- a ] was missing ...
4
votes
How do I search/replace with case sensitive search?
Use isearch (C-s), turn on case sensitivity (M-c) then launch replace (M-%) from there.
M-c runs the command isearch-toggle-case-fold
M-% runs the command isearch-query-replace
3
votes
Accepted
How can I query replace region from top case-sensitively?
You need to let-bind case-fold-search to nil:
(defun query-replace-region-or-from-top ()
(interactive)
(let ((case-fold-search nil))
(progn
...
(goto-char orig-point)))))
See ...
3
votes
Accepted
How to ignore case when switching buffers?
Customize option read-buffer-completion-ignore-case to non-nil.
C-h v read-buffer-completion-ignore-case tells you:
read-buffer-completion-ignore-case is a variable defined in C source code.
...
3
votes
Accepted
I-search - case sensitive
You can toggle case sensitivity during incremental search by typing M-c.
Documentation here.
2
votes
in Emacs regex, how to search for uppercase letters only?
Be aware that there are some mistakes in that code. I don't know if \* means anything at all in this context (\\* does). You also need to escape + with two backslashes as that has a meaning in emacs ...
2
votes
How to do case sensitive searches using evil's evil-search?
Super old question, but for anyone looking for a more vim-like solution, try this:
(defun set-noic()
"set case sensitive"
(interactive)
(setq evil-ex-search-case 'sensitive))
(defun ...
2
votes
Accepted
case-fold-search apparently not taking effect in re-search-forward
What is wrong with my use of case-fold-search?
You've set it to t instead of nil.
case-fold-search is a variable defined in C source code.
[...]
Non-nil if searches and matches should ignore ...
2
votes
Accepted
How to query-replace with exact match with the exact given word in case-sensetive manner?
Do M-x toggle-case-fold-search (message is Case-Insensitive Search disabled globally) before Q.
toggle-case-fold-search isn't a standard variable but rather a function. Perhaps you wanted to set ...
1
vote
Single letter abbrev and expansion case
It's not the most elegant solution, but of course a workaround is to simply define uppercase and lowercase single-letter abbrevs.
Example:
(define-abbrev-table 'text-mode-abbrev-table
'(("t&...
1
vote
Accepted
Single letter abbrev and expansion case
Bottom line: I don't see a way to have a lowercase, single-letter abbrev expand to a capitalized single word. I think your solution (answer) is maybe the best workaround.
The Emacs manual, node ...
1
vote
How can I use 'transients' in 'magit' to enable case-insensitive search?
I have fixed that regression, see #209.
1
vote
Accepted
How can I recursively find and replace text in case sensetive?
As already mentioned in the comments the variable case-fold-search is buffer-local.
The following line in your init file sets this variable only for the buffer to nil where the init file is evaluated:
...
1
vote
Accepted
How do I search/replace with case sensitive search?
Bind or set case-fold-search to nil.
C-h k M-% tells us:
M-% runs the command query-replace (found in global-map), which is an
interactive compiled Lisp function in replace.el.
It is bound to M-%, &...
1
vote
Why after search-toggle-case-fold text is select?
Note, that I assume that isearch-toggle-case-fold is not supposed to be run outside of isearch-mode.
Cause of the effect:
The highlighting belongs to the overlay stored in variable isearch-overlay ...
1
vote
1
vote
Highlight regexp case insensitive
You can easily do what you want with library Highlight (highlight.el.
Just set or bind case-fold-search to t and call any of the regexp-highlighting functions:
hlt-highlight-regexp-to-end - Matches ...
1
vote
Case-sensitive search and replace in elisp in spacemacs
The following change to xx-replace-regexp-and-return solves the problem:
(defun xx-replace-regexp-and-return (from to)
(let ((case-fold-search nil)))
(save-excursion
(while (re-search-...
1
vote
How to turn every ALL CAP word in a buffer into Title case?
If you want to take @phils answer and wrap it in a command that handles the region, here's one approach:
(defun caps-to-title-case (start end)
"Convert words in CAPS to Title Case in the current ...
1
vote
Accepted
How can i keep the case when I am using select and paste to C-s input field?
The relevant configuration option is search-upper-case.
As with many things, you can find this information in Emacs itself. For example, use C-h r to open the Emacs manual, and use i to search the ...
1
vote
how do I do case sensitive searches using evil/spacemacs?
Dan's answer was the solution in my case. Nevertheless, I also had to set the variable as default in my init.el in order to work:
(setq-default case-fold-search nil)
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
case-folding × 23search × 8
replace × 5
query-replace × 4
regular-expressions × 3
isearch × 3
evil × 2
org-mode × 1
spacemacs × 1
magit × 1
buffers × 1
helm × 1
dired × 1
completion × 1
minibuffer × 1
projectile × 1
highlighting × 1
copy-paste × 1
abbrev × 1
bibtex × 1
let-binding × 1
ag × 1
find × 1
transients × 1