1

I am currently trying to set up my config so that I can use evil-mode while also using the space key as a local leader for some command while mapping my keys with general.el package.

;; hide tool bar
(tool-bar-mode -1)

(setq-default tab-width 4)

;; add melpa
(require 'package)
(add-to-list 'package-archives
             '("melpa" . "https://melpa.org/packages/") t)

(use-package evil
         :ensure t
         :config
         (progn
           (evil-mode 1)
           ;(use-package evil-leader
           ;     :ensure t
           ;     :config
           ;     (global-evil-leader-mode))
           (require 'evil-leader)
           (setq evil-default-cursor t)))

;; for providing wrappers for defining keybindings
(use-package general
         :ensure t)


;; for telling me which key does what
(use-package which-key
         :ensure t
         :config
         (progn
           (setq which-key-idle-delay 0.5)
           (which-key-mode +1)))

(general-define-key
 :state 'normal
 :prefix "SPC"
 "w/" 'split-window-right)

But when I run the config I get the following error

error: Key sequence SPC w / starts with non-prefix key SPC

I have tried unbinding the space key but even when I do so my keybinding doesn't work and the space key just works as it normally does in normal mode. What am I missing here, is it some kind of conflict between general and evil-leader or am I just missing something?

1 Answer 1

2

I managed to get the wanted behaviour by using the following

(general-evil-define-key 'normal 'global
 :prefix "SPC"
 "w/" 'split-window-right)
1
  • Feel free to improve your answer like from where that you found the solution and accept it as answer!! Apr 10, 2021 at 8:53

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.