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's user avatar
  • 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's user avatar
  • 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 ...
phils's user avatar
  • 49.5k
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 ...
Lindydancer's user avatar
  • 6,105
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
xuchunyang's user avatar
  • 14.4k
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 ...
NickD's user avatar
  • 28.2k
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. ...
Drew's user avatar
  • 76.3k
3 votes
Accepted

I-search - case sensitive

You can toggle case sensitivity during incremental search by typing M-c. Documentation here.
Juancho's user avatar
  • 5,435
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 ...
Zorgoth's user avatar
  • 820
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 ...
farnsy's user avatar
  • 161
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 ...
phils's user avatar
  • 49.5k
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 ...
Mark's user avatar
  • 81
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&...
NTC's user avatar
  • 47
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 ...
Drew's user avatar
  • 76.3k
1 vote

How can I use 'transients' in 'magit' to enable case-insensitive search?

I have fixed that regression, see #209.
tarsius's user avatar
  • 25.4k
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: ...
Tobias's user avatar
  • 32.8k
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-%, &...
Drew's user avatar
  • 76.3k
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 ...
Tobias's user avatar
  • 32.8k
1 vote

I-search - case sensitive

C-s M-c C-s for isearch and when in minibuffer type M-c
Talespin_Kit's user avatar
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 ...
Drew's user avatar
  • 76.3k
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-...
deshmukh's user avatar
  • 1,862
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 ...
glucas's user avatar
  • 20.4k
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 ...
glucas's user avatar
  • 20.4k
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)
JoseleMG's user avatar
  • 111

Only top scored, non community-wiki answers of a minimum length are eligible