I am using combination of following solutions in order to
find-and-replace matched text in all Python files:
I observe that when I want to replace capital words like "HELLO_WORLD" , it also replaces
hello_world string as well.
(setq case-fold-search nil) (defun find-and-replace () (interactive) (message "press t to toggle mark for all files found && Press Q for Query-Replace in Files...") (find-dired (vc-git-root (buffer-file-name)) "-name \\*.py -o ! -name flycheck_\\*.py ! -name __init__.py ! -name \".*\" ! -name build ! -path \\*/.eggs/\\*"))
M-x find-and-replace ; then
t to toggle marked/unmarked files (thus marking them all, since none were marked). Then I use
Q to use
query-replace on the marked files. And enter
HELLO_WORLD to replace with
How can I fix
find-and-replace to work in case-sensetive?