gabesoft / evil-mc

Multiple cursors implementation for evil-mode
MIT License
383 stars 35 forks source link

Is it possible to unbind C-p and C-n? #52

Closed joonro closed 7 years ago

joonro commented 7 years ago

Hi,

I would like to unbind C-p and C-n. I tried the following but it did not work:

(define-key evil-mc-key-map (kbd "C-p") 'nil)

Could you please let me know how to do this? Thanks a lot.

gabesoft commented 7 years ago

That should work. Use nil not 'nil

joonro commented 7 years ago

Thanks for the reply. I did eval-region on the following lines:

  (define-key evil-mc-key-map (kbd "C-p") nil)
  (define-key evil-normal-state-map (kbd "C-p") nil)
  (define-key evil-visual-state-map (kbd "C-p") nil)

but for some reason it does not work. C-h k C-p shows the following:

C-p runs the command evil-mc-make-and-goto-prev-match, which is an interactive
compiled Lisp function in ‘evil-mc-cursor-make.el’.

It is bound to C-p, <visual-state> C-p, <normal-state> C-p.

(evil-mc-make-and-goto-prev-match)

Initialize ‘evil-mc-pattern’, make a cursor at point, and go to the previous match.
gabesoft commented 7 years ago

Try this

  (define-key evil-mc-key-map (kbd "C-p") nil)
  (evil-define-key 'normal evil-mc-key-map (kbd "C-p") nil)
  (evil-define-key 'visual evil-mc-key-map (kbd "C-p") nil)
joonro commented 7 years ago

That worked perfectly. Thank you very much.