简体   繁体   中英

How do you rebind a key set by CUA mode in Emacs?

In my .emacs I have:

(cua-mode 1)

I would like to use Alt-V for next-buffer , but CUA mode sets it to delete-selection-repeat-replace-region . I've tried this:

(global-unset-key (kbd "M-v"))
(global-set-key   (kbd "M-v") 'next-buffer)

This doesn't work, I assume because the global key map is shadowed by the cua mode one, so how do I change it?

You are completely correct, cua-mode is shadowing the global map. I believe the solution is:

(define-key cua--cua-keys-keymap (kbd "M-v") 'next-buffer)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM