How to map CMD+P to CTRL+P without actually modifiying CMD from root

StackOverflow https://stackoverflow.com/questions/23351782

  •  11-07-2023
  •  | 
  •  

سؤال

I want to map command + P => Ctrl+P in vim. How can I do this? I tried doing

 map <D-P> <C-P>

But this doesn't seem to work, it is still firing print command.

PS: I know i can do this with BetterTouchTool but it is kindof hack. Isn't possible with vim configuration ?

هل كانت مفيدة؟

المحلول

At first you have to remove default mapping, you could do it in ~/.gvimrc file by the following:

macmenu File.Print key=<nop>

then, you can just map it as usual

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top