I have a specific problem that when I run "grep", my default grep command contains the -i
option, and sometimes I wish to repeat the last search but case-sensitive. So I press M-p
(previous command),
grep <some-options> -i lastSearchWord
then a number of M-b
(backward-word) to get to the -i
option, but this puts me between "-" and "i": so then I have to switch to C-b M-d
to delete the option. And it's annoying to switch from Meta to Control here (and the need for this extra command at all): it would be more helpful to get the cursor to before the "-".
I know it's possible to redefine the categorization of characters per mode, but I am out of touch with Emacs terminology so don't know what to search for. How do I redefine "-" to be a "word character" in the Minibuffer only?
lgrep
you can just customize optiongrep-template
to be what you want, i.e., to not include-i
. – Drew Apr 01 '22 at 17:32How to define "-" as a word character in minibuffer?
You cannot get better than that, and I hate it when people who think they're doing something for the improvement actually make stuff worse. Such a waste. – Alexander Apr 04 '22 at 07:14