-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
It's Not bug report. Evil delete without yank #6977
Comments
I doubt you can override this behaviour, but if there's something in your kill-ring that you need to preserve, I would either:
|
You can specify a register before issuing a command to have the contents be moved to that register. For example, In your case, you can specify the register as P.S. I would recommend enabling the |
@NJBS @chrisbarrett I rarely use register list, so I just want override |
I'm not sure how to apply it to just those operations but you can make (defun bb/evil-delete (orig-fn beg end &optional type _ &rest args)
(apply orig-fn beg end type ?_ args))
(advice-add 'evil-delete :around 'bb/evil-delete) |
@TheBB thanks a lot, 5 Stars! That's I wantted, I find it nearlly 1 month.. |
Just to say that @qx is not the only one feeling that way, this specific behaviour has been one of the only things that annoyed me when I switched to hybrid mode. Is this a wanted behaviour that exist for a reason that I (we) didn't get ? With even single character entries ? Anyways, thanks for this piece of code @TheBB, this is really useful 😄 |
@deb0ch I also want to know , WHY evil/vim |
I can't speak for the original rationale but as a vimmer for 10 years I use it a lot, basically whenever I move stuff around.
It's even more rare that I want to paste something that I didn't copy immediately before, so it's usually not a problem to me that deleted stuff hangs around in the registers. In the cases where I do need it, the paste transient state that @NJBS mentioned handles everything gracefully. |
Being new to vim / evil style I find that the cut / delete distinction that exist in nearly all other editor makes sense and is convenient. Would there be a way of having separate cut and delete keys without breaking evil users workflow ? |
Yeah, if However it shouldn't be a big deal to make a PR to evil to change the default register. It'd be more flexible than my solution. |
Yep that's a good idea because it would be kind of tedious to add two extra steps every time you want to delete something ( I was also thinking of using the prefix argument, like either providing it to choose the register or providing a negative one to choose the I really like the idea of being able to choose the default register though. |
This is how it can be achieved in vim https://github.com/pazams/d-is-for-delete @TheBB if you add this advice around the default evil-delete, how would you cut then? (delete and yank) |
I think having a command to switch the default register would be nice to have or even just a toggle from the unnamed yank register to the black hole register. |
In insert mode, using does not add to the kill ring. That's how I get around this. |
@TheBB I'm trying to use this snippet you gave on Sep. 1, 2016, but encountering a weird interaction with evil-surround: Without this code, using the standard behavior of But with this code, when I do Running Emacs 27.1 with Doom. I've only been looking at Elisp for 2 weeks, so my debugging capability is pretty limited. Obviously this is code you tossed out 7 years ago so I won't expect exhaustive tech support on it! If you do have an idea I can try to figure it out from wherever you might lose the trail. Otherwise I suppose I can mostly work around it by just using |
It's Not bug report. I just want to know is there any way to delete some words without yank last deleted when I press
dd
,orx
.I really annoyed by this yank too much.
The text was updated successfully, but these errors were encountered: