I am trying to define key bindings with general.el following emacs from scratch. However, the leader-prefix key (SPC) does not seem to work from the Emacs start-up page (Fundamental mode). It works with scratch and messages buffer though. However, reloading the config again makes it work. It is very annoying since I can not immediately use customized key bindings from the Fundamental mode page.

Here is my config for general:

(use-package general
     :states '(global normal insert visual motion emacs)
     :keymaps 'override
     :prefix "SPC"
     :non-normal-prefix "C-SPC"
     "" nil

     "SPC"  '(counsel-M-x :which-key "M-x")
     "."    '(find-file :which-key "find file")
     "r"    '(:ignore r :which-key "toggles")
     "r f"  '(counsel-recentf :which-key "recent files")
     "r r"  '((lambda () (interactive) (load-file "C:/Users/saske/.emacs.d/init.el")) :which-key "reload config")
     "r t"  '(counsel-load-theme :which-key "choose theme")
     "r c"  '((lambda () (interactive) (find-file "C:/Users/saske/.emacs.d/config.org")) :which-key "edit config")))

I have used keymaps instead of states as well. Can anyone please give me a fix here so that the prefix also works from the Emacs start-up page?

I have followed the answers from here and a few other places (of which I am not able to find the references at the moment). But nothing worked.

I am very new to emacs. Maybe I have a wrong understanding of this.


Your Answer

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