Just began transitioning from vim to spacemacs and I can't find a way to define keymappings such as this:

nnoremap N Nzz

I tried defining it like this:

define-key evil-normal-state-map (kbd "N") (kbd "Nzz"))

... but using the "N" in the right hand side of the mapping causes the following error:

error "Lisp nesting exceeds 'max-lisp-eval-depth'".

Is there a way to define non-recursive keybindings with kbd?

  • Do C-h k (stands for C-h: help and k: keybinding). Use these functions to bind it to N key, instead the keys itself. – ReneFroger Jul 16 '16 at 23:48
  • 1
    There is no such thing. You're generally encouraged to write a command Doing The Right Thing™ and bind it to a key. Alternatively, advise the command to recenter afterwards... – wasamasa Jul 17 '16 at 7:40

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.