-
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
How can I remap vim black hole register? #5288
Comments
It's not so simple. Maybe this will work? (evil-define-operator my-delete (beg end type)
(interactive "<R><x><y>")
(evil-delete beg end type ?_))
(define-key normal-state-map "d" 'my-delete)
(define-key visual-state-map "d" 'my-delete) |
@TheBB "interactive" |
I have tried, I don't think this is working ... |
What about: (define-key evil-normal-state-map (kbd "d") (lambda ()
(interactive)
(evil-use-register ?_)
(call-interactively 'evil-delete))) |
I am sorry, but no, they all perform the same with nothing set... |
As far as I understood what your code is supposed to do, the one I proposed is doing the same. Maybe I didn't understood it correctly, so can you provide us more information:
|
If you would like to remap more operators, you may find my config to be useful. |
It might be more fruitful for you to ask this at the evil repo instead of here. |
i will try to ask the question there! |
@chantisnake, did you manage to get an answer? I have tried the "evil-define-operator" approach in the above for the bindings with keys "-d", but deleting lines with "-dd" does not work. In more detail:
Guys, is the latter behaviour expected, am I missing something? EDIT: The "lambda ()" approach in the above with "-d" binding behaves exactly the same way. |
With my "-d" mapping:
Maybe this has something to do with the following? Purely brainstorming here, I have truly no idea really. At How do I change only what “dd” does in evil-mode's normal-state in a minor mode, I have found the following comment:
The next comment there points to the
Unfortunately, I cannot make sense of the code below the comments, as I do not know Emacs Lisp at all. |
I found the solution: https://bitbucket.org/lyro/evil/issues/468/how-delete-to-the-register-in-a-keymap
|
I don't know how to set that up in evil...
The text was updated successfully, but these errors were encountered: