doomemacs / doomemacs/core

C-w in command mode and minibuffer inconsistent with Vim/evil

Open
#7,926 4 comments 0 reactions 0 assignees View on GitHub
:editor evil
Dominant language
Emacs Lisp
Stars
22.7k
Forks
3.1k
Avg merge
10h 46m
Merged PRs (30d)
4

Description

### I confirm that...

- [X] I have searched the [issue tracker](https://github.com/doomemacs/doomemacs/issues), [documentation](https://docs.doomemacs.org), [FAQ](https://docs.doomemacs.org/-/faq), [Discourse](https://discourse.doomemacs.org), and [Google](https://google.com), in case this issue has already been reported/resolved.
- [X] I have read "[How to Debug Issues](https://doomemacs.org/d/how2debug)", and will use it to provide as much information about this issue as possible.
- [X] The issue can be reproduced on the **latest** available commit of Doom.
- [X] The issue can be reproduced on a stable release of Emacs, such as 27, 28, or 29. *(Unstable versions end in .50, .60, or .9x)*

### Expected behavior

Deleting words with `C-w` in the minibuffer and ex-commands[^1] should function the same as `C-w` in insert mode, i.e. delete Vim/Evil words (sequence of word characters or non-word characters).
Probably call `evil-delete-backward-word` like in insert mode.

### Current behavior

When typing in a command with `:` [^1] or in a minibuffer, `C-w` will call either `backward-kill-word` or `doom/delete-backward-word`. Both of these use the Emacs definition of words and not the Evil one as `evil-delete-backward-word` does

### Steps to reproduce

1. Open Emacs (w/ Evil enabled as per default)
2. (optional) Open scratch buffer, insert some text, and `C-w` it
3. Open the minibuffer (e.g., by using `M-x`)
4. Type "test -- -test"
5. Press `C-w` twice
6. Observe the entire line being deleted, instead of just "-test"

### System Information

https://pastebin.com/3uMUDVHx

[^1]: edit: I believe the ex-commands case is an upstream issue ([#1921](https://github.com/emacs-evil/evil/issues/1921)). I've edited the report (and reproduction steps) reflect that

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the minibuffer case with Evil enabled using the command sequence in the issue. Inspect the bindings for C-w and compare backward-kill-word, doom/delete-backward-word, and evil-delete-backward-word; done means minibuffer deletion follows Evil word boundaries, while the separate ex-command case remains subject to the linked upstream issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
emacs, emacs-lisp
Domain
developer-experience, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.