0

I like to use evil-define-key like so:

(evil-define-key 'normal projectile-mode-map
  (kbd "M-o") 'projectile-switch-to-buffer)

This is great because I can make bindings for both an emacs mode and an evil state at the same time.

Unfortunately though I cannot figure out how to integrate this style, with key-chord-mode.

I thought I had found the solution with the following, but this is a different kind of key-chord than the ones provided by key-chord-mode.

(evil-define-key 'normal projectile-mode-map
   (kbd "<key-chord> po") 'projectile-switch-to-buffer

Is there a way to essentially say the following?:

(evil-define-key 'normal projectile-mode-map
   (key-chord-define "po") 'projectile-switch-to-buffer))
2
  • You almost have the solution. If you look more closely at key-chord-define you note that you just need to define the key sequence additionally with reversed sequence of letters. (evil-define-key 'normal projectile-mode-map (kbd "<key-chord> op") 'projectile-switch-to-buffer). – Tobias Jan 30 at 4:50
  • You could use general.el, a great wrapper for bindings: (general-define-key :keymaps 'projectile-mode-map :states 'insert (general-chord "po") 'projectile-switch-to-buffer (general-chord "op") 'projectile-switch-to-buffer). Make sure you enable key-chord-mode to make it work. – Hubisan Jan 31 at 22:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.