I'm not experienced with viper-mode
, but something like the following appears to work based on the limited testing I've done:
(add-hook 'viper-load-hook
#'(lambda ()
(define-key viper-insert-basic-map (kbd "C-d") nil)
(define-key viper-insert-basic-map (kbd "C-d C-d") 'kill-line)))
You can add whatever other definitions you require to that hook to ensure that they're evaluated upon start-up. You'll need to be careful with your chosen key bindings, however. C-y
, for example, which you specifically mentioned, is normally bound to yank
, and I suspect that's something you probably don't want to un-bind. Also, viper-mode
appears to use a pretty complex and elaborate set of overlapping keymaps, so depending on what functionality you wish to enable, you may need to specify a different one (or, indeed, several different ones to be used in parallel), such as viper-vi-global-user-map
, viper-insert-global-user-map
, etc. Unfortunately, that's about the extent of my expertise w/r/t viper-mode
.
Edit: Sorry, I think I may have misunderstood your request. If you want to apply these key-bindings outside of viper-mode
, use global-set-key
, i.e.:
(global-unset-key (kbd "C-d"))
(global-set-key (kbd "C-d C-d") 'kill-line)
And so on. Again, be careful of the bindings that you set. Use describe-key
(bound by default to C-h k
) to check what the key sequence you wish to remap is currently bound to.