C-w support yank word when search-module is 'evil-search
Could you describe what behaviour this is trying to achieve? C-w deletes the previous work in the search prompt in vim.
same to C-w in isearch, search words under point ,and you can press C-w multiple times
Yes, actually C-w should have the opposite behavior. It should delete the previous word in the Ex minibuffer since that is how vim does it. That is more in line with how evil is meant to behave anyways since its main goal is to emulate vi/vim.
But there are variables like evil-want-C-u-scroll which take into account discrepancies between fundamental keys used in both Emacs and Vim but have different meaning. Perhaps this could be another one of those cases and we could have an
evil-want-C-w-delete-in-search variable or just piggyback off of evil-want-C-w-delete? I'm thinking the latter makes more sense since if someone is already used to the Emacs way of C-w meaning to kill text, they wouldn't want that behavior to be different in Ex/search. If this is done then it would probably make sense for evil-ex-completion-map to also obey evil-want-C-w-delete.
Now that evil-want-C-w-delete is used to opt into yanking, it would be great if this could get reviewed and merged. This is the only thing stopping me from using evil-search as my main search module.
I encountered the following issue:
alphaBetCatDog
If evil-ex-search-case is smart and I use evil-search-forward with evil-search and type bet C-w, the search string changes to betCat and fails to match.
With isearch-forward, typing bet C-w changes the search string to betcat. I think this is the preferred behavior when evil-ex-search-case is set to smart.
evil-ex-search-case
fixed
evil-ex-search-casefixed
With isearch-forward and smart casing, if an uppercase char is typed into the search string, the C-w invocations preserve case. For example, in a buffer with alphaBetCatDog, typing M-x isearch-forward and Bet C-w changes the search string to BetCat.
Currently, using the patched evil-search module and evil-ex-search-case set to smart, typing Bet C-w changes the search string to Betcat, which fails to match.
evil-ex-search-casefixed
With
isearch-forwardand smart casing, if an uppercase char is typed into the search string, theC-winvocations preserve case. For example, in a buffer withalphaBetCatDog, typingM-x isearch-forwardandBet C-wchanges the search string toBetCat.Currently, using the patched
evil-searchmodule andevil-ex-search-caseset tosmart, typingBet C-wchanges the search string toBetcat, which fails to match.
fixed.
Is this still being experimented with or is there another way to get the desired behavior?
@angrybacon I'll take a look soon and merge if all looks good
As soon as github actions recovers (https://www.githubstatus.com/) I will merge #1694 and close this.
Closed by #1694