0

I'm trying to disable the command key when running emacs from the terminal. Whenever I mistakenly press CMD-V instead of ALT-V, the text from my Mac clipboard gets copied into the buffer. From related questions, I've tried adding setq mac-command-modifier 'none or 'meta and setq ns-command-modifier 'none to my .emacs file. There is no effect. How can I disable the command key in emacs? If I can't disable it, can I rebind CMD-V to do nothing?

2
  • I don't use Emacs in the terminal, but this works in the GUI version to effectively disable Command+v by causing it to do nothing except execute the function ignore: (global-set-key [?\s-v] 'ignore)
    – lawlist
    Mar 30, 2018 at 21:17
  • Thanks for the suggestion, but adding this to my .emacs did nothing. Mar 31, 2018 at 0:29

1 Answer 1

1

Isn't it just your terminal program pasting the text into the terminal? I'm not sure emacs can stop it.

If you are using iterm, one option is to create a separate profile for emacs, then under "Keys" bind command-V to ignore. You obviously would only want to run emacs under this profile to maintain normal pasting in other terminals.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.